95
96
97
98
99
100
101
102
103
104
105
106
107
|
# File 'lib/sorcery/model/submodules/external.rb', line 95
def add_provider_to_user(provider, uid)
authentications = sorcery_config.authentications_class.name.demodulize.underscore.pluralize
if sorcery_adapter.find_authentication_by_oauth_credentials(authentications, provider, uid).nil?
user = send(authentications).build(sorcery_config.provider_uid_attribute_name => uid,
sorcery_config.provider_attribute_name => provider)
user.sorcery_adapter.save(validate: false)
else
user = false
end
user
end
|