@W-20224082 - [Webauthn] Create passkey in browser and register in SLAS#3584
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| resendAttempt: true | ||
| }) | ||
| await handleSendEmailOtp(form.getValues('email')) | ||
| otpInputs.clear() |
There was a problem hiding this comment.
Should clear the OTP input when shopper clicks Resend Code
…ation Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
…ceCommerceCloud/pwa-kit into W-20224082-passkey-registration
packages/template-retail-react-app/app/components/passkey-registration-modal/index.jsx
Outdated
Show resolved
Hide resolved
packages/template-retail-react-app/app/components/passkey-registration-modal/index.jsx
Outdated
Show resolved
Hide resolved
| const errorMessage = | ||
| err.message || | ||
| formatMessage({ | ||
| id: 'passkey_registration.modal.error.registration_failed', | ||
| defaultMessage: 'Failed to register passkey' | ||
| }) |
There was a problem hiding this comment.
should we always return the localized error message and never the api error mesage? or map error messages from the API to a localized message similar to what we did here: https://salesforce.quip.com/97bPANYv5D2U
There was a problem hiding this comment.
Thinking through this again, we will definitely need a localized error for some errors like when the /webauthn/register/authorize returns "Too many webauthn user authorization requests were made. Please try again later.".
How about we keep the error handling generic and create a separate story for error handling for registration and login to make sure we handle all the cases.
There was a problem hiding this comment.
Sounds good - Created the ticket https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002TfC8TYAV/view
| }) | ||
| } catch (createError) { | ||
| // Handle user cancellation or other errors from the WebAuthn API | ||
| if (createError.name === 'NotAllowedError' || createError.name === 'AbortError') { |
There was a problem hiding this comment.
should we include a comment on when each of these errors are thrown?
e.g., AbortError implies the action was stopped, NotAllowedError implies a lack of permission or authorization.
There was a problem hiding this comment.
This will be addressed in the error handling ticket - will note in the description of the new work item!
Description
Submitting the OTP should prompt the shopper to create a passkey on the browser, which is then registered in SLAS.
Types of Changes
Changes
/webauthn/register/startendpointnavigator.credentials.create()is then called with the response data from thestart endpoint/webauthn/register/finishendpoint to save the passkeyHow to Test-Drive This PR
webauthn/register/finishendpoint and all modals are closedTo run unit tests:
npm run test app/components/passkey-registration-modalChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization