Implement Passkey registration

- Create Identity credentials
- Add management UI and registration flow
This commit is contained in:
Stanko K.R.
2026-02-13 16:58:06 +01:00
parent 4bb0a2929c
commit 6c58fd9bdd
16 changed files with 330 additions and 19 deletions
+1
View File
@@ -2,6 +2,7 @@ class Identity < ApplicationRecord
include Joinable, Transferable
has_many :access_tokens, dependent: :destroy
has_many :credentials, dependent: :destroy
has_many :magic_links, dependent: :destroy
has_many :sessions, dependent: :destroy
has_many :users, dependent: :nullify
+13
View File
@@ -0,0 +1,13 @@
class Identity::Credential < ApplicationRecord
belongs_to :identity
serialize :transports, coder: JSON, type: Array, default: []
def to_public_key_credential
ActionPack::WebAuthn::PublicKeyCredential.new(
id: credential_id,
public_key: public_key,
transports: transports
)
end
end