app/controllers/devise_token_auth/omniauth_callbacks_controller.rb
# break out provider attribute assignment for easy method extension
break out provider attribute assignment for easy method extension
break out provider attribute assignment for easy method extension
def assign_provider_attrs(user, auth_hash)
      attributes = devise_parameter_sanitizer.instance_values['permitted'][:sign_up].inject({}) do |hash, attribute|
        hash[attribute.to_sym] = auth_hash['info'][attribute.to_s] if user.has_attribute?(attribute.to_sym) && auth_hash['info'][attribute.to_s]
        hash
      end
      attributes = attributes.merge({raw: user.raw.merge({auth_hash['provider'] => auth_hash})}) if user.has_attribute?(:raw)
      user.assign_attributes(attributes)
    end
def assign_provider_attrs ( user , auth_hash ) attributes = devise_parameter_sanitizer . instance_values [ 'permitted' ] [ :sign_up ] . inject ( { } ) do | hash , attribute | hash [ attribute . to_sym ] = auth_hash [ 'info' ] [ attribute . to_s ] if user . has_attribute? ( attribute . to_sym ) && auth_hash [ 'info' ] [ attribute . to_s ] hash end attributes = attributes . merge ( { raw : user . raw . merge ( { auth_hash [ 'provider' ] => auth_hash } ) } ) if user . has_attribute? ( :raw ) user . assign_attributes ( attributes ) end
break out provider attribute assignment for easy method extension
break out provider attribute assignment for easy method extension
user
auth_hash