Class: Oauth::AuthorizationsController

Inherits:
Doorkeeper::AuthorizationsController
  • Object
show all
Includes:
Gitlab::GonHelper, Gitlab::Utils::StrongMemoize, InitializesCurrentUserMode
Defined in:
app/controllers/oauth/authorizations_controller.rb

Instance Method Summary collapse

Methods included from InitializesCurrentUserMode

#current_user_mode

Methods included from Gitlab::GonHelper

#add_browsersdk_tracking, #add_gon_variables, #default_avatar_url, #push_force_frontend_feature_flag, #push_frontend_feature_flag, #push_to_gon_attributes

Methods included from WebpackHelper

#prefetch_link_tag, #webpack_bundle_tag, #webpack_controller_bundle_tags, #webpack_entrypoint_paths, #webpack_preload_asset_tag, #webpack_public_host, #webpack_public_path

Methods included from ViteHelper

#universal_asset_path, #universal_javascript_include_tag

Instance Method Details

#newObject

Overridden from Doorkeeper::AuthorizationsController to include the call to session.delete



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/oauth/authorizations_controller.rb', line 15

def new
  if pre_auth.authorizable?

    if skip_authorization? || (matching_token? && pre_auth.client.application.confidential?)
      auth = authorization.authorize
      parsed_redirect_uri = URI.parse(auth.redirect_uri)
      session.delete(:user_return_to)
      Authorizations::NotificationService.new(current_user).execute

      render "doorkeeper/authorizations/redirect", locals: { redirect_uri: parsed_redirect_uri }, layout: false
    else
      redirect_uri = URI(authorization.authorize.redirect_uri)
      allow_redirect_uri_form_action(redirect_uri.scheme)
      Authorizations::NotificationService.new(current_user).execute

      render "doorkeeper/authorizations/new"
    end
  else
    render "doorkeeper/authorizations/error"
  end
end