Skip to content

@W-20474693 - [WebauthN] Passkey Registration#3571

Merged
yunakim714 merged 24 commits intofeature/webauthn-loginfrom
W-20474693-passkey-creation
Jan 20, 2026
Merged

@W-20474693 - [WebauthN] Passkey Registration#3571
yunakim714 merged 24 commits intofeature/webauthn-loginfrom
W-20474693-passkey-creation

Conversation

@yunakim714
Copy link
Collaborator

@yunakim714 yunakim714 commented Jan 9, 2026

Description

This PR implements the passkey registration functionality.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

How Passkey Registration works:

  1. When a shopper logs in or creates an account successfully, they are prompted with a Create Passkey toast on the secure account page. This should work successfully regardless of where the shopper logs in. Shoppers can log in from:
    a. AuthModal
    b. Login page
    c. Checkout page
    d. Register page (when creating an account)
  2. Clicking Create Passkey prompts the shopper to enter an optional nickname for their passkey.
  3. Clicking Register Passkey sends a POST to request an OTP (calls the authorizeWebauthnRegistration AuthHelper in commerce-sdk-react
  4. Shopper is prompted to enter the 8 digit OTP
  5. ... (Next steps will be implemented in follow up ticket)
    a. W-20474693 - [PWA Kit][WebAuthn][Passkey Registration] Implement Passkey nickname creation and authorization
Screenshot 2026-01-13 at 10 00 08 AM Screenshot 2026-01-13 at 10 00 22 AM Screenshot 2026-01-13 at 11 18 06 AM

How to Test-Drive This PR

To test e2e:

  • Navigate to https://wasatch-mrt-yuna.mrt-storefront-staging.com/
  • Log in via the following storefront pages/components and verify that the Create Passkey toast is prompted on successful login / account creation
    • AuthModal - login & registration
    • Login page
    • Register page (when creating an account)
  • When you click Create Passkey after inputting a passkey name, you should see a successful POST to the webhook URL like so:
Screenshot 2026-01-14 at 5 21 54 PM

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Jan 9, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@yunakim714 yunakim714 changed the base branch from develop to feature/webauthn-login January 9, 2026 21:13
@@ -0,0 +1,348 @@
/*
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

otp-auth files have been pulled from the One click checkout feature branch. This PR reuses the OtpAuth modal created by the 1CC team.

Comment on lines +111 to +113
if (isRegistered && config?.app?.login?.passkey?.enabled) {
showToast()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only show the Passkey Registration toast if the feature flag is enabled in the config file

Comment on lines +62 to +69
await authorizeWebauthnRegistration.mutateAsync({
user_id: customer.email,
mode: webauthnConfig.mode,
channel_id: commerceApiConfig.parameters.siteId,
...(webauthnConfig.mode === 'callback' && {
callback_uri: webauthnConfig.callbackURI
})
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Call to the authorizeWebauthnRegistration AuthHelper

@yunakim714 yunakim714 marked this pull request as ready for review January 13, 2026 20:03
@yunakim714 yunakim714 requested a review from a team as a code owner January 13, 2026 20:03
"auth_modal.info.welcome_user": {
"defaultMessage": "Welcome {name},"
},
"auth_modal.passkey.button.close.assistive_msg": {
Copy link
Collaborator

@hajinsuha1 hajinsuha1 Jan 15, 2026

Choose a reason for hiding this comment

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

@yunakim714 as we don't have a dedicated UX person for this epic, could you start a sheet to keep track of any of the new text we added so that we can get it reviewed by Spencer later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure! I'll create a sheet for any new Webauthn text labels

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yunakim714 yunakim714 requested a review from alexvuong January 15, 2026 20:47
// We are done with the modal.
onClose()

if ((loggingIn || registering) && customer.data && config?.app?.login?.passkey?.enabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm finding that when registering using the auth-modal, it doesn't show the create passkey toast. It looks like its because customer.data is undefined right after registering.

Also I see this code block repeated a couple times. When a user logs in or registers they seem to always be redirected to the /accounts page (except during passwordless login with a redirect). Would we consider moving this logic to only be called in the accounts page?

I think we can ignore the passwordless case, because if a user is shopping and they want to quickly checkout we may not want to prompt to create a passkey.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if this is the desired behavior, but sometimes when I log in from the auth modal on the home page, I am not navigated to the account page.
Also, if we only added this code block on the account page - we would have to use a session item to identify when the user is navigated here from a successful login / account creation. I could switch to this approach if needed! For now, I resolved the bug where this doesn't show up when registering via auth modal

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm testing out the login from auth and I also see sometimes it redirects to the accounts page and sometimes does not 🤔
Looking at the code, it seems like logging in from use-auth-modal should not redirect to the accounts page because onLoginSuccess() is noop. Wonder if this is a bug.
But with that said what you have makes sense.

@yunakim714 yunakim714 added the skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated label Jan 16, 2026
Comment on lines +203 to +206
// Navigate after passkey check completes (whether toast is shown or not)
navigate(redirectTo)
})
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: could we remove the return and navigate(redirectTo) and let line 211 handle it?

@yunakim714 yunakim714 removed the request for review from alexvuong January 20, 2026 20:43
@yunakim714 yunakim714 merged commit 22df1c1 into feature/webauthn-login Jan 20, 2026
17 of 42 checks passed
@yunakim714 yunakim714 deleted the W-20474693-passkey-creation branch January 20, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants