Class: OmniAuth::Strategies::Mastodon
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Mastodon
- Defined in:
- lib/omniauth/strategies/mastodon.rb
Constant Summary collapse
- DEFAULT_SCOPE =
'read'.freeze
Instance Method Summary collapse
- #authorize_params ⇒ Object
- #callback_phase ⇒ Object
- #callback_url ⇒ Object
- #raw_info ⇒ Object
-
#request_phase ⇒ Object
Before we can redirect the user to authorize access, we must know where the user is from If the identifier param is not already present, a form will be shown for entering it.
Instance Method Details
#authorize_params ⇒ Object
53 54 55 56 57 |
# File 'lib/omniauth/strategies/mastodon.rb', line 53 def super.tap do |params| params[:scope] ||= DEFAULT_SCOPE end end |
#callback_phase ⇒ Object
40 41 42 43 |
# File 'lib/omniauth/strategies/mastodon.rb', line 40 def callback_phase super end |
#callback_url ⇒ Object
49 50 51 |
# File 'lib/omniauth/strategies/mastodon.rb', line 49 def callback_url full_host + script_name + callback_path end |
#raw_info ⇒ Object
45 46 47 |
# File 'lib/omniauth/strategies/mastodon.rb', line 45 def raw_info @raw_info ||= access_token.get('api/v1/accounts/verify_credentials').parsed end |
#request_phase ⇒ Object
Before we can redirect the user to authorize access, we must know where the user is from If the identifier param is not already present, a form will be shown for entering it
36 37 38 |
# File 'lib/omniauth/strategies/mastodon.rb', line 36 def request_phase identifier ? start_oauth : get_identifier end |