Class: Booth::Userland::Sessions::Transitions::Destroy::WebauthAuthenticationInitiation
- Inherits:
-
Object
- Object
- Booth::Userland::Sessions::Transitions::Destroy::WebauthAuthenticationInitiation
- Includes:
- Concerns::Transition
- Defined in:
- lib/booth/userland/sessions/transitions/destroy/webauth_authentication_initiation.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.applicable?(params:) ⇒ Boolean
11 12 13 |
# File 'lib/booth/userland/sessions/transitions/destroy/webauth_authentication_initiation.rb', line 11 def self.applicable?(params:) params[:webauth] && !params.key?(:handshake) end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/booth/userland/sessions/transitions/destroy/webauth_authentication_initiation.rb', line 15 def call log { 'Preparing webauth challenge...' } credential = ::Booth::Models::Credential.find(authentication.credential_id) challenging = Booth::Core::Credentials::WebauthChallenge.call(credential:, request:) result = Tron.success :webauth_for_you, public_json: challenging., http_status: :created log { "The challenge is #{challenging.challenge}" } sudo.webauthn_challenge = challenging.challenge log { "Responding with JSON: #{result.public_json}" } result end |