Class: Gitlab::Auth::Otp::Strategies::FortiTokenCloud

Inherits:
Base
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/auth/otp/strategies/forti_token_cloud.rb

Constant Summary collapse

BASE_API_URL =
'https://ftc.fortinet.com:9696/api/v1'

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Gitlab::Auth::Otp::Strategies::Base

Instance Method Details

#validate(otp_code) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/auth/otp/strategies/forti_token_cloud.rb', line 11

def validate(otp_code)
  if access_token_create_response.created?
    otp_verification_response = verify_otp(otp_code)

    otp_verification_response.ok? ? success : error_from_response(otp_verification_response)
  else
    error_from_response(access_token_create_response)
  end
end