Class: NewsmastMastodon::AuthenticateUserService
- Inherits:
-
BaseService
- Object
- BaseService
- NewsmastMastodon::AuthenticateUserService
- Defined in:
- app/services/newsmast_mastodon/authenticate_user_service.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(base_url, email, password) ⇒ AuthenticateUserService
constructor
A new instance of AuthenticateUserService.
Constructor Details
#initialize(base_url, email, password) ⇒ AuthenticateUserService
Returns a new instance of AuthenticateUserService.
9 10 11 12 13 14 |
# File 'app/services/newsmast_mastodon/authenticate_user_service.rb', line 9 def initialize(base_url, email, password) @base_url = base_url @email = email @password = password @endpoint = '/oauth/token' end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/services/newsmast_mastodon/authenticate_user_service.rb', line 16 def call validate_oauth_credentials! response = perform_request parse_response(response) rescue StandardError => e Rails.logger.error "[AuthenticateUserService] Error: #{e.class} - #{e.}" raise e end |