Skip to content

feat(core,react): add passkey component#312

Open
NaveenChand755 wants to merge 9 commits into
feat/create-user-passkey-hookfrom
feat/passkey-management-components
Open

feat(core,react): add passkey component#312
NaveenChand755 wants to merge 9 commits into
feat/create-user-passkey-hookfrom
feat/passkey-management-components

Conversation

@NaveenChand755
Copy link
Copy Markdown
Contributor

@NaveenChand755 NaveenChand755 commented May 28, 2026

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/core
  • packages/react
  • examples

References

Screenshot 2026-05-28 at 11 45 14 PM Screenshot 2026-05-29 at 2 09 44 AM Screenshot 2026-05-29 at 2 09 50 AM

Testing

How can this be verified? Note anything intentionally not covered by tests and why.

  • This change adds unit test coverage
  • Tested for both SPA and RWA flows, all example apps working
  • All existing and new tests complete without errors

Checklist

  • Breaking change
  • Requires docs update
  • Backward compatible

Contributing

const passkey = m as PasskeyAuthMethodResponse;
return {
id: passkey.id,
name: `Passkey ${index + 1}`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have a translation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since api will be returning name its just temporary fallback do we need i18n for it ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good to have it

Comment thread packages/react/src/components/auth0/my-account/user-passkey-management.tsx Outdated
Comment on lines -65 to -73
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;
Copy link
Copy Markdown
Contributor

@rax7389 rax7389 May 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also remove them from UseUserPasskeyReturn

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this will make significant code refactor, it would leave this as is and just remove disableRename prop as of now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

type: 'passkey',
})) as CreatePasskeyResponse;
const { auth_session, authn_params_public_key } = startResponse;
const authenticationMethodId = 'passkey|new';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but why this id has to be hardcoded?


const handleConfirm = React.useCallback(async () => {
if (mode === 'rename') {
if (!name.trim()) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have few other validations like max length and character restrictions? also lets use schemas?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

api doesnt support this yet , so wont be adding it to now will be added later

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

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.

2 participants