Class: OmniAuth::Strategies::Threads
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Threads
- Defined in:
- lib/omniauth/strategies/threads.rb
Constant Summary collapse
- DEFAULT_SCOPE =
"threads_basic"- DEFAULT_FIELDS =
"id,username,name,threads_profile_picture_url,threads_biography"
Instance Method Summary collapse
Instance Method Details
#callback_url ⇒ Object
47 48 49 |
# File 'lib/omniauth/strategies/threads.rb', line 47 def callback_url full_host + callback_path end |
#long_lived_token ⇒ Object
55 56 57 |
# File 'lib/omniauth/strategies/threads.rb', line 55 def long_lived_token @long_lived_token ||= ::OAuth2::AccessToken.from_hash(client, access_token.get("/access_token", params: {grant_type: "th_exchange_token", client_secret: .client_secret, access_token: access_token.token}).parsed) end |
#raw_info ⇒ Object
51 52 53 |
# File 'lib/omniauth/strategies/threads.rb', line 51 def raw_info @raw_info ||= long_lived_token.get("/me", params: {fields: DEFAULT_FIELDS}).parsed end |
#token_params ⇒ Object
40 41 42 43 44 45 |
# File 'lib/omniauth/strategies/threads.rb', line 40 def token_params super.tap do |params| params[:client_id] = .client_id params[:client_secret] = .client_secret end end |