Class: Oauth::AuthorizationsController

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

Constant Summary

Constants included from Gitlab::Logging::CloudflareHelper

Gitlab::Logging::CloudflareHelper::CLOUDFLARE_CUSTOM_HEADERS

Instance Method Summary collapse

Methods included from RequestPayloadLogger

#append_info_to_payload

Methods included from Gitlab::Logging::CloudflareHelper

#store_cloudflare_headers!, #valid_cloudflare_header?

Methods included from InitializesCurrentUserMode

#current_user_mode

Methods included from Gitlab::GonHelper

#add_browsersdk_tracking, #add_gon_feature_flags, #add_gon_user_specific, #add_gon_variables, #current_organization, #default_avatar_url, #push_force_frontend_feature_flag, #push_frontend_ability, #push_frontend_feature_flag, #push_namespace_setting, #push_to_gon_attributes

Methods included from Organizations::OrganizationHelper

#admin_organizations_index_app_data, #organization_activity_app_data, #organization_groups_and_projects_app_data, #organization_groups_edit_app_data, #organization_groups_new_app_data, #organization_index_app_data, #organization_layout_nav, #organization_new_app_data, #organization_projects_edit_app_data, #organization_settings_general_app_data, #organization_show_app_data, #organization_user_app_data, #ui_for_organizations_enabled?

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_path_to_stylesheet, #universal_stylesheet_link_tag, #vite_enabled?, #vite_page_entrypoint_paths

Instance Method Details

#newObject

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



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/oauth/authorizations_controller.rb', line 24

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)
      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)

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