feat(core,react): add passkey component#312
Conversation
| const passkey = m as PasskeyAuthMethodResponse; | ||
| return { | ||
| id: passkey.id, | ||
| name: `Passkey ${index + 1}`, |
There was a problem hiding this comment.
we should have a translation?
There was a problem hiding this comment.
since api will be returning name its just temporary fallback do we need i18n for it ?
| isRenameModalOpen: boolean; | ||
| currentPasskey: Passkey | null; | ||
| handleAddPasskey: () => void; | ||
| handleRenamePasskey: (passkey: Passkey) => void; | ||
| handleRevokePasskey: (passkey: Passkey) => void; | ||
| handleConfirmRevoke: () => Promise<void>; | ||
| handleConfirmRename: (newName?: string) => Promise<void>; | ||
| setIsRevokeModalOpen: (open: boolean) => void; | ||
| setIsRenameModalOpen: (open: boolean) => void; |
There was a problem hiding this comment.
can we also remove them from UseUserPasskeyReturn
There was a problem hiding this comment.
removing this will make significant code refactor, it would leave this as is and just remove disableRename prop as of now
| type: 'passkey', | ||
| })) as CreatePasskeyResponse; | ||
| const { auth_session, authn_params_public_key } = startResponse; | ||
| const authenticationMethodId = 'passkey|new'; |
There was a problem hiding this comment.
Not sure but why this id has to be hardcoded?
|
|
||
| const handleConfirm = React.useCallback(async () => { | ||
| if (mode === 'rename') { | ||
| if (!name.trim()) return; |
There was a problem hiding this comment.
can we have few other validations like max length and character restrictions? also lets use schemas?
There was a problem hiding this comment.
api doesnt support this yet , so wont be adding it to now will be added later
Summary
Adds full passkey management (view/add/rename/revoke) as a drop-in component
Why
Extends the library with passkey support following the same pattern as MFA management — consistent hook architecture, action lifecycle hooks (onBefore/onAfter/onErrorAction), and delegating error handling to the existing GateKeeper and useErrorHandler infrastructure
What
Adds passkey management — users can view, add, rename, and revoke passkeys. Includes WebAuthn encoding utils, My Account API service hook, UI logic hook, UserPasskeyMgmt component with a shared PasskeyActionModal, i18n translations, and full test coverage.
Packages
packages/corepackages/reactexamplesReferences
Testing
How can this be verified? Note anything intentionally not covered by tests and why.
Checklist
Contributing