Class: StandardId::Oauth::PasswordlessOtpFlow

Inherits:
TokenGrantFlow show all
Defined in:
lib/standard_id/oauth/passwordless_otp_flow.rb

Instance Attribute Summary

Attributes inherited from TokenGrantFlow

#params, #request

Attributes inherited from BaseRequestFlow

#current_account, #params, #request

Instance Method Summary collapse

Methods inherited from TokenGrantFlow

#execute, extra_permitted_keys, #initialize

Methods inherited from BaseRequestFlow

expect_params, expected_params, extra_permitted_keys, #initialize, permit_params, permitted_params

Constructor Details

This class inherits a constructor from StandardId::Oauth::TokenGrantFlow

Instance Method Details

#authenticate!Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/standard_id/oauth/passwordless_otp_flow.rb', line 7

def authenticate!
  validate_client_secret!(params[:client_id], params[:client_secret]) if params[:client_secret].present?

  raise StandardId::InvalidGrantError, "Invalid or expired verification code" if code_challenge.blank?
  raise StandardId::InvalidGrantError, "Unable to authenticate user" if .blank?

  validate_requested_scope!

  code_challenge.use!
end