Class: Stall::OmniauthUserAuthenticationService
- Inherits:
-
BaseService
- Object
- BaseService
- Stall::OmniauthUserAuthenticationService
- Defined in:
- app/services/stall/omniauth_user_authentication_service.rb
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(email, auth) ⇒ OmniauthUserAuthenticationService
constructor
A new instance of OmniauthUserAuthenticationService.
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
#auth ⇒ Object (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 |
#email ⇒ Object (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
#call ⇒ Object
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 |