Skip to content

fix(core): handle reset password case during login#2750

Merged
jorgemoya merged 1 commit intocanaryfrom
catalyst-1609-reset-password-error
Dec 4, 2025
Merged

fix(core): handle reset password case during login#2750
jorgemoya merged 1 commit intocanaryfrom
catalyst-1609-reset-password-error

Conversation

@jorgemoya
Copy link
Contributor

@jorgemoya jorgemoya commented Dec 4, 2025

What/Why?

Improved login error handling to display a custom error message when BigCommerce indicates a password reset is required, instead of showing a generic error message.

Testing

Locally
Screenshot 2025-12-04 at 2 36 35 PM

Migration

Step 1: Update Translation Files

Add this translation key to your locale files (e.g., core/messages/en.json):

{
  "Auth": {
    "Login": {
      "passwordResetRequired": "Password reset required. Please check your email for instructions to reset your password.",
    }
  }
}

Repeat for all supported locales if you maintain custom translations.

Step 2: Update Login Server Action

In your login server action (e.g., core/app/[locale]/(default)/(auth)/login/_actions/login.ts):

Add the password reset error handling block:

if (
  error instanceof AuthError &&
  error.type === 'CallbackRouteError' &&
  error.cause &&
  error.cause.err instanceof BigCommerceGQLError &&
  error.cause.err.message.includes('Reset password"')
) {
  return submission.reply({ formErrors: [t('passwordResetRequired')] });
}

This should be placed in your error handling, before the generic "Invalid credentials" check.

@jorgemoya jorgemoya requested a review from a team as a code owner December 4, 2025 20:33
@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

🦋 Changeset detected

Latest commit: 555a3e5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
catalyst-b2b Ready Ready Preview Comment Dec 4, 2025 8:44pm
catalyst-canary Ready Ready Preview Comment Dec 4, 2025 8:44pm
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
catalyst Ignored Ignored Dec 4, 2025 8:44pm
catalyst-uplift-vertex Ignored Ignored Dec 4, 2025 8:44pm

@jorgemoya jorgemoya added this pull request to the merge queue Dec 4, 2025
Merged via the queue into canary with commit c22f0e8 Dec 4, 2025
12 checks passed
@jorgemoya jorgemoya deleted the catalyst-1609-reset-password-error branch December 4, 2025 21:57
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