Skip to content

@W-20398991 - Forgot Password link not working from Account Profile password update form#3493

Merged
giridhari-gupta merged 2 commits intodevelopfrom
W-20276592.giridhari.gupta.issue.3486
Dec 5, 2025
Merged

@W-20398991 - Forgot Password link not working from Account Profile password update form#3493
giridhari-gupta merged 2 commits intodevelopfrom
W-20276592.giridhari.gupta.issue.3486

Conversation

@giridhari-gupta
Copy link
Contributor

Description

fix(account): Correct "Forgot Password" link behavior

The link within the UpdatePasswordFields component, which is intended to navigate to /reset-password, was not working when accessed from the main Account Profile page (/account).

This change ensures that clicking the link allowing the user to navigate to the password reset flow as expected.

Fixes #3486

Screen.Recording.2025-12-03.at.3.04.49.PM.mov

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

Files involved:

  • packages/template-retail-react-app/app/pages/account/index.jsx (line 234 - passes handleForgotPasswordClick prop)
  • packages/template-retail-react-app/app/pages/account/profile.jsx (line 367 - receives and passes prop to PasswordCard)
  • packages/template-retail-react-app/app/components/forms/update-password-fields.jsx (line 34 - button with onClick handler)

Code reference:
The handleForgotPasswordClick prop is defined in app/pages/account/index.jsx:avascript

<AccountDetail 
    handleForgotPasswordClick={() => navigate('/reset-password')}
/>

And is used in app/components/forms/update-password-fields.jsx:script

<Button variant="link" size="sm" onClick={handleForgotPasswordClick}>
    <FormattedMessage
        defaultMessage="Forgot Password?"
        id="update_password_fields.button.forgot_password"
    />
</Button>

Note: The same pattern works correctly on the login page (/login), where the "Forgot password?" link successfully navigates to /reset-password. This suggests the issue may be specific to the account profile context or form submission interference.

How to Test-Drive This PR

Screen.Recording.2025-12-03.at.2.53.36.PM.mov

Sandbox Deployment: https://cc-pulse-giri-testing-space.sfdc-3vx9f4-commerceecom.exp-delivery-staging.com/

  1. Log in to the application
  2. Navigate to the Account page (/account)
  3. Click to edit the Password section
  4. In the password update form, click the "Forgot Password?" link below the "Current Password" field
  5. Observe that the navigation to /reset-password will work now.

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)

@giridhari-gupta giridhari-gupta self-assigned this Dec 4, 2025
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Dec 4, 2025

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.

@giridhari-gupta giridhari-gupta marked this pull request as ready for review December 5, 2025 07:26
@giridhari-gupta giridhari-gupta requested a review from a team as a code owner December 5, 2025 07:26
@giridhari-gupta giridhari-gupta added the ready for review PR is ready to be reviewed label Dec 5, 2025
@@ -1,4 +1,5 @@
## v8.3.0-dev (Nov 05, 2025)
- [Bugfix] Fix Forgot Password link not working from Account Profile password update form [#3487](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3487)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: updated PR number in changelog

Suggested change
- [Bugfix] Fix Forgot Password link not working from Account Profile password update form [#3487](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3487)
- [Bugfix] Fix Forgot Password link not working from Account Profile password update form [#3493](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3493)

Also, Should we close PR #3487 as a duplicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

/>
</Button>
</Box>
{handleForgotPasswordClick && (
Copy link
Contributor

@adamraya adamraya Dec 5, 2025

Choose a reason for hiding this comment

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

We could consider adding small tests covering the new branching logic, E.g. it does not render Forgot Password button when handleForgotPasswordClick is not provided, and clicking the Forgot Password calls handleForgotPasswordClick, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree can we get a little bit of test created around this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added unit test cases.

fix(account): Correct "Forgot Password" link behavior

The link within the `UpdatePasswordFields` component, which is intended to navigate to `/reset-password`, was not working when accessed from the main Account Profile page (`/account`).

This change ensures that clicking the link bypasses any potential form submission or event propagation interference, allowing the user to navigate to the password reset flow as expected.

Fixes #3486
- Added Unit test cases to code coverage.
@giridhari-gupta giridhari-gupta force-pushed the W-20276592.giridhari.gupta.issue.3486 branch from 6a30e72 to 3495a3c Compare December 5, 2025 21:16
@giridhari-gupta giridhari-gupta merged commit 4de195b into develop Dec 5, 2025
42 checks passed
@giridhari-gupta giridhari-gupta deleted the W-20276592.giridhari.gupta.issue.3486 branch December 5, 2025 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review PR is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Forgot Password link not working from Account Profile password update form

5 participants