Module: GDS::SSO::User::ClassMethods
- Defined in:
- lib/gds-sso/user.rb
Instance Method Summary collapse
Instance Method Details
#find_for_gds_oauth(auth_hash) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/gds-sso/user.rb', line 37 def find_for_gds_oauth(auth_hash) if user = self.where(:uid => auth_hash["uid"]).first user.update_attributes(GDS::SSO::User.user_params_from_auth_hash(auth_hash.to_hash), as: :oauth) user else # Create a new user. self.create!(GDS::SSO::User.user_params_from_auth_hash(auth_hash.to_hash), as: :oauth) end end |