Class: Oauth::TokensController

Inherits:
Doorkeeper::TokensController
  • Object
show all
Includes:
EnforcesTwoFactorAuthentication, Gitlab::InternalEventsTracking, RequestPayloadLogger
Defined in:
app/controllers/oauth/tokens_controller.rb

Constant Summary

Constants included from Gitlab::Logging::JsonMetadataHelper

Gitlab::Logging::JsonMetadataHelper::JSON_METADATA_HEADERS

Constants included from Gitlab::Logging::CloudflareHelper

Gitlab::Logging::CloudflareHelper::CLOUDFLARE_CUSTOM_HEADERS

Instance Method Summary collapse

Methods included from Gitlab::InternalEventsTracking

#track_internal_event

Methods included from Gitlab::Logging::JsonMetadataHelper

#store_json_metadata_headers!

Methods included from Gitlab::Logging::CloudflareHelper

#store_cloudflare_headers!, #valid_cloudflare_header?

Methods included from EnforcesTwoFactorAuthentication

#check_two_factor_requirement, #current_user_requires_two_factor?, #execute_action_for_2fa_reason, #mfa_help_page_url, #skip_two_factor?, #two_factor_authentication_required?, #two_factor_grace_period, #two_factor_grace_period_expired?, #two_factor_skippable?, #two_factor_verifier

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/oauth/tokens_controller.rb', line 12

def create
  if authorize_response.status == :ok
    track_internal_event(
      'oauth_authorize_with_gitlab',
      user: authorize_response.token.resource_owner,
      additional_properties: {
        label: server.client.present?.to_s,
        property: params[:grant_type] # rubocop:disable Rails/StrongParams -- This pattern is followed in the gem
      }
    )
  end

  super
end