Skip to content

@W-20890250 Handle request limit and monthly quota error states for passwordless and reset password#3574

Merged
hajinsuha1 merged 8 commits intofeature/email-otpfrom
W-20890250-handle-error-states-passwordless-and-reset-password
Jan 16, 2026
Merged

@W-20890250 Handle request limit and monthly quota error states for passwordless and reset password#3574
hajinsuha1 merged 8 commits intofeature/email-otpfrom
W-20890250-handle-error-states-passwordless-and-reset-password

Conversation

@hajinsuha1
Copy link
Collaborator

@hajinsuha1 hajinsuha1 commented Jan 14, 2026

Description

Adds a new "Too many requests" error message when /passwordless/login or /password/reset return a 400 response:

{
  "status_code" : "400 BAD_REQUEST",
  "message" : "Too many login requests were made. Please try again later."
}

/passwordless/login returns too many requests error:
Screenshot 2026-01-14 at 2 28 15 PM

/password/reset returns too many requests error:
Screenshot 2026-01-14 at 10 20 26 AM

Also updated Email Confirmation page to display errors if form has any set. This ensures if the "Too many requests" error is returned, when a user spams the "Resend Link" button, the error is displayed.

Screenshot 2026-01-14 at 4 14 58 PM

Full list of API error to UI error message mapping can be found here

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

  • display errors in Email Confirmation page
  • added new auth-utils.js that contains utility methods for mapping passwordless and reset password API error messages to user-friendly error messages
  • added mapping of the following API error messages:
    • "no callback_uri is registered for client" -> "This feature is not currently available"
    • "Too many login requests were made. Please try again later." -> Too many requests. For your security, please wait 10 ** minutes before trying again.
    • "Monthly quota for passwordless login mode email has been exceeded" -> "This feature is not currently available"

How to Test-Drive This PR

Too many requests error

  1. Navigate to https://wasatch-mrt-feature-private.mrt-storefront-staging.com/us/en-us
  2. Open the developer console
  3. Click on the profile icon on the top right, enter your email, click the Continue button. Then click Resend Link button 6 times in 10 minutes.
  4. Verify Too many requests. For your security, please wait 10 minutes before trying again. error is displayed
    Screenshot 2026-01-14 at 4 14 58 PM
  5. Close and reopen the auth modal, enter your email, click the Continue button.
  6. Verify Too many requests. For your security, please wait 10 minutes before trying again. error is displayed
    Screenshot 2026-01-14 at 2 28 15 PM
  7. Click Password button, click Forgot Password link. Click Reset Password and repeat this 3 more times to trigger the too many requests error
  8. Verify Too many requests. For your security, please wait 10 minutes before trying again. error is displayed
    Screenshot 2026-01-14 at 10 20 26 AM
  9. Repeat these steps in the login page: https://wasatch-mrt-feature-private.mrt-storefront-staging.com/us/en-us/login
    Screenshot 2026-01-14 at 5 21 36 PM
    Screenshot 2026-01-14 at 5 22 00 PM
    Screenshot 2026-01-14 at 5 22 35 PM

no callback_uri is registered for client error

  1. Navigate to https://wasatch-mrt-passwordless-poc.mrt-storefront-staging.com/us/en-us
  2. Click on the profile icon on the top right, enter your email, click the Continue button.
  3. Verify This feature is not currently available. error is displayed
    Screenshot 2026-01-14 at 5 16 14 PM
  4. Click Password button, click Forgot Password link. Click Reset Password.
  5. Verify This feature is not currently available. error is displayed
    Screenshot 2026-01-14 at 5 16 02 PM
  6. Repeat these steps in the login page: https://wasatch-mrt-passwordless-poc.mrt-storefront-staging.com/us/en-us/login

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)

…, update Commerce API parameters to test with staging-001"

This reverts commit 66bcafa.
…swordlessLogin and getPasswordResetToken errors
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Jan 14, 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.

Comment on lines +1355 to +1359
const res = await slasClient.getPasswordResetToken(options, true)
if (res && res.status !== 200) {
const errorData = await res.json()
throw new Error(`${res.status} ${String(errorData.message)}`)
}
Copy link
Collaborator Author

@hajinsuha1 hajinsuha1 Jan 14, 2026

Choose a reason for hiding this comment

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

calling getPasswordResetToken(options, true) returns the rawResponse which was need to pass the error message to retail-react-app for determining which error message to display

Comment on lines +49 to +56
{form.formState.errors?.global && (
<Alert status="error">
<AlertIcon color="red.500" boxSize={4} />
<Text fontSize="sm" ml={3}>
{form.formState.errors.global.message}
</Text>
</Alert>
)}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been added to the email confirmation page now that we need to display a "Too many requests" error

Image

SOCIAL: 'social'
}

export const PASSWORDLESS_ERROR_MESSAGES = [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this has been moved to auth-utils.js above and renamed to PASSWORDLESS_FEATURE_UNAVAILABLE_ERRORS as it is only used there

@hajinsuha1 hajinsuha1 marked this pull request as ready for review January 15, 2026 15:01
@hajinsuha1 hajinsuha1 requested a review from a team as a code owner January 15, 2026 15:01
@hajinsuha1 hajinsuha1 merged commit 3d79932 into feature/email-otp Jan 16, 2026
42 checks passed
@hajinsuha1 hajinsuha1 deleted the W-20890250-handle-error-states-passwordless-and-reset-password branch January 16, 2026 14:43
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.

3 participants