Skip to content

Generate webauthn_id lazily when registration options are requested - #148

Merged
santiagorodriguez96 merged 8 commits into
masterfrom
sr--generate-webauthn-id-lazily
Jul 10, 2026
Merged

Generate webauthn_id lazily when registration options are requested#148
santiagorodriguez96 merged 8 commits into
masterfrom
sr--generate-webauthn-id-lazily

Conversation

@santiagorodriguez96

Copy link
Copy Markdown
Collaborator

Motivation

Fixes #146.

Details

Instead of eagerly generating webauthn_id in a before_validation callback, the resource's webauthn_id is now generated and persisted via a new ensure_webauthn_id! method the first time WebAuthn registration options are requested. Since existing records no longer need a webauthn_id upfront, the backfill was removed from the migration generated by devise:webauthn:webauthn_id.

Comment thread lib/devise/models/webauthn_credential_authenticatable.rb Outdated
Comment thread lib/devise/models/webauthn_credential_authenticatable.rb Outdated
Comment thread lib/devise/models/webauthn_credential_authenticatable.rb
Comment thread app/controllers/devise/passkey_registration_options_controller.rb Outdated
Base automatically changed from sr--post-options-endpoints to master July 9, 2026 18:52
@santiagorodriguez96
santiagorodriguez96 merged commit da54288 into master Jul 10, 2026
31 checks passed
@santiagorodriguez96
santiagorodriguez96 deleted the sr--generate-webauthn-id-lazily branch July 10, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate webauthn_id lazily instead of backfilling at migration time

2 participants