Class: Devise::PasskeysController
- Inherits:
-
DeviseController
- Object
- DeviseController
- Devise::PasskeysController
- Defined in:
- app/controllers/devise/passkeys_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/devise/passkeys_controller.rb', line 9 def create passkey_from_params = WebAuthn::Credential.from_create(JSON.parse(params[:public_key_credential])) if verify_and_save_passkey(passkey_from_params) :notice, :passkey_created else :alert, :passkey_verification_failed, scope: :"devise.failure" end redirect_to after_update_path rescue WebAuthn::Error :alert, :passkey_verification_failed, scope: :"devise.failure" redirect_to after_update_path ensure session.delete(:webauthn_challenge) end |
#destroy ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/devise/passkeys_controller.rb', line 25 def destroy if resource.passkeys.destroy(params[:id]) :notice, :passkey_deleted else :alert, :passkey_deletion_failed, scope: :"devise.failure" end redirect_to after_update_path end |
#new ⇒ Object
7 |
# File 'app/controllers/devise/passkeys_controller.rb', line 7 def new; end |