Class: StandardId::Api::Oauth::Callback::ProvidersController

Inherits:
BaseController show all
Includes:
SocialAuthentication
Defined in:
app/controllers/standard_id/api/oauth/callback/providers_controller.rb

Constant Summary

Constants included from SocialAuthentication

SocialAuthentication::VALID_LINK_STRATEGIES

Constants included from RateLimitHandling

RateLimitHandling::RATE_LIMIT_STORE

Instance Method Summary collapse

Methods included from ControllerPolicy

all_controllers, authenticated_controllers, public_controllers, register, registry_snapshot, reset_registry!

Instance Method Details

#callbackObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/controllers/standard_id/api/oauth/callback/providers_controller.rb', line 11

def callback
  provider_response = (flow: resolve_flow_for(provider.provider_name))
  social_info = provider_response[:user_info]
  provider_tokens = provider_response[:tokens]
   = (social_info)

  flow = StandardId::Oauth::SocialFlow.new(
    params,
    request,
    account:,
    connection: provider.provider_name,
    scopes: params[:scope]
  )

  token_response = flow.execute
  run_social_callback(
    provider: provider.provider_name,
    social_info:,
    provider_tokens:,
    account:,
  )
  render json: token_response, status: :ok
end