Class: Models::Users::Authentication

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/restpack_user_service/models/authentication.rb

Class Method Summary collapse

Class Method Details

.from_omniauth(application_id, omniauth) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/restpack_user_service/models/authentication.rb', line 14

def self.from_omniauth(application_id, omniauth)
  Authentication.new(
    application_id: application_id,
    provider: omniauth['provider'],
    uid: omniauth['uid'],
    omniauth: omniauth
  )
end

.get_by_omniauth(application_id, omniauth) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/restpack_user_service/models/authentication.rb', line 23

def self.get_by_omniauth(application_id, omniauth)
  Authentication.where(
    application_id: application_id,
    provider: omniauth['provider'],
    uid: omniauth['uid']
  ).first
end