Class: StandardId::Oauth::PasswordlessOtpFlow
- Inherits:
-
TokenGrantFlow
- Object
- BaseRequestFlow
- TokenGrantFlow
- StandardId::Oauth::PasswordlessOtpFlow
- Defined in:
- lib/standard_id/oauth/passwordless_otp_flow.rb
Instance Attribute Summary
Attributes inherited from TokenGrantFlow
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 17 18 19 20 21 22 23 |
# 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? if code_challenge.blank? emit_otp_validation_failed raise StandardId::InvalidGrantError, "Invalid or expired verification code" end if account.blank? raise StandardId::InvalidGrantError, "Unable to authenticate user" end validate_requested_scope! code_challenge.use! emit_otp_validated end |