Class: Stall::OmniauthUserAuthenticationService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/stall/omniauth_user_authentication_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email, auth) ⇒ OmniauthUserAuthenticationService

Returns a new instance of OmniauthUserAuthenticationService.



5
6
7
8
# File 'app/services/stall/omniauth_user_authentication_service.rb', line 5

def initialize(email, auth)
  @email = email
  @auth = auth
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



3
4
5
# File 'app/services/stall/omniauth_user_authentication_service.rb', line 3

def auth
  @auth
end

#emailObject (readonly)

Returns the value of attribute email.



3
4
5
# File 'app/services/stall/omniauth_user_authentication_service.rb', line 3

def email
  @email
end

Instance Method Details

#callObject



10
11
12
13
14
15
16
17
# File 'app/services/stall/omniauth_user_authentication_service.rb', line 10

def call
  if existing_user
    ensure_omniauth_account!(existing_user, auth)
    existing_user
  else
    create_user_from_auth!
  end
end