Module: Devise::Models::WebauthnCredentialAuthenticatable

Extended by:
ActiveSupport::Concern
Included in:
PasskeyAuthenticatable, WebauthnTwoFactorAuthenticatable
Defined in:
lib/devise/models/webauthn_credential_authenticatable.rb

Instance Method Summary collapse

Instance Method Details

#ensure_webauthn_id!Object



16
17
18
19
20
21
22
23
# File 'lib/devise/models/webauthn_credential_authenticatable.rb', line 16

def ensure_webauthn_id!
  return webauthn_id if webauthn_id.present?

  self.webauthn_id = WebAuthn.generate_user_id
  save!(validate: false)

  webauthn_id
end