Implement Passkey registration
- Create Identity credentials - Add management UI and registration flow
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user