Module: Sorcery::Model::Submodules::Oauth::ClassMethods

Defined in:
lib/sorcery/model/submodules/oauth.rb

Instance Method Summary collapse

Instance Method Details

#load_from_provider(provider, uid) ⇒ Object

takes a provider and uid and finds a user by them.



39
40
41
42
43
# File 'lib/sorcery/model/submodules/oauth.rb', line 39

def load_from_provider(provider,uid)
  config = sorcery_config
  authentication = config.authentications_class.find_by_provider_and_uid(provider, uid)
  user = find(authentication.send(config.authentications_user_id_attribute_name)) if authentication
end