Class: BaseAuthenticator
- Inherits:
-
Object
- Object
- BaseAuthenticator
- Defined in:
- app/services/base_authenticator.rb
Defined Under Namespace
Classes: ApiError
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#initialize(auth_code) ⇒ BaseAuthenticator
constructor
A new instance of BaseAuthenticator.
Constructor Details
#initialize(auth_code) ⇒ BaseAuthenticator
Returns a new instance of BaseAuthenticator.
5 6 7 |
# File 'app/services/base_authenticator.rb', line 5 def initialize(auth_code) @auth_code = auth_code end |
Instance Method Details
#authenticate! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/services/base_authenticator.rb', line 9 def authenticate! user = get_user(access_token) login = find_login(user) if login.present? connect_login_to_account(login, user) else login = create_login_from_account(user) end login end |