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
55 56 57 58 59 |
# File 'lib/omniauth/strategies/mastodon.rb', line 55 def super.tap do |params| params[:scope] ||= DEFAULT_SCOPE end end |
#callback_phase ⇒ Object
42 43 44 45 |
# File 'lib/omniauth/strategies/mastodon.rb', line 42 def callback_phase super end |
#callback_url ⇒ Object
51 52 53 |
# File 'lib/omniauth/strategies/mastodon.rb', line 51 def callback_url full_host + script_name + callback_path end |
#raw_info ⇒ Object
47 48 49 |
# File 'lib/omniauth/strategies/mastodon.rb', line 47 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
37 38 39 40 |
# File 'lib/omniauth/strategies/mastodon.rb', line 37 def request_phase # identifier ? start_oauth : get_identifier start_oauth end |