Module: RailsSimpleAuth::Models::Concerns::OAuthConnectable

Extended by:
ActiveSupport::Concern
Defined in:
lib/rails_simple_auth/models/concerns/oauth_connectable.rb

Instance Method Summary collapse

Instance Method Details

#assign_oauth_attributes(auth_hash) ⇒ Object

Override this in your model to map additional OAuth fields Example:

def assign_oauth_attributes(auth_hash)
  self.name = auth_hash.dig("info", "name")
  self.avatar_url = auth_hash.dig("info", "image")
  self.oauth_provider = auth_hash["provider"]
  self.oauth_uid = auth_hash["uid"]
end


95
96
97
# File 'lib/rails_simple_auth/models/concerns/oauth_connectable.rb', line 95

def assign_oauth_attributes(auth_hash)
  # Default: no-op, override in your model
end