mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Find ominauth user only based on user id for a service provider.
This commit is contained in:
parent
f3b2956e6e
commit
91b4bc84f5
@ -4,7 +4,7 @@ class OmniauthUser < ActiveRecord::Base
|
||||
validates :user, presence: true
|
||||
|
||||
def self.from_omniauth(auth, current_user)
|
||||
omniauth_user = find_by(provider: auth.provider, uid: auth.uid, email: auth.info.email)
|
||||
omniauth_user = find_by(provider: auth.provider, uid: auth.uid)
|
||||
return omniauth_user.user if omniauth_user.present?
|
||||
|
||||
user = current_user || User.find_by(email: auth.info.email) || User.create(email: auth.info.email, password: Devise.friendly_token[0,20])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user