Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@W-15953350 Reset Password #2132

Open
wants to merge 28 commits into
base: W-17093012-passwordless-poc-mc
Choose a base branch
from

Conversation

hajinsuha1
Copy link
Collaborator

@hajinsuha1 hajinsuha1 commented Nov 13, 2024

Description

Revamps the Reset Password flow in the PWA Kit to leverage the SLAS password reset process and Marketing Cloud integration to send the reset password magic link to the shopper.

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

  • Add usePasswordReset() hook to the template app
  • Created a demo PWA Kit Email sender for token delivery

How to Test-Drive This PR

  • Navigate to Reset Password POC branch with latest changes: https://wasatch-mrt-reset-password-poc.mrt-storefront-staging.com/global/en-GB/login
    • This environment uses private client
  • Initiate the reset password flow:
    • Enter your email
    • Click Password
    • Click Forgot password?
    • Enter the email associated with your account
    • ⚠️This flow occurs in 3 places, the login modal, the login page, and the checkout page. Verify reset password flow works in all 3 locations⚠️
  • Check your email to verify that you received an email from [email protected] with a magic link, redirecting to the reset password form
  • Verify that your password is reset successfully and you are redirected to the login page

To run tests:

  • From template-retail-react-app: run npm run test app/hooks/use-password-reset.test.js

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)

@yunakim714 yunakim714 changed the title @W-15953350 Reset Password POC (Monitoring Cloud) @W-15953350 Reset Password Dec 4, 2024
@yunakim714 yunakim714 marked this pull request as ready for review December 5, 2024 19:35
@yunakim714 yunakim714 requested a review from a team as a code owner December 5, 2024 19:35
`${slasClient.clientConfig.parameters.clientId}:${this.clientSecret}`
)}`
}
// TODO: no code verifier needed with the fix blair has made, delete this when the fix has been merged to production
Copy link
Collaborator

Choose a reason for hiding this comment

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

Stale comment?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nope, this is to delete the @ts-ignore comment, as right now we get an error because we are not passing in code_verifier

const getPasswordResetToken = async (email) => {
await getPasswordResetTokenMutation.mutateAsync({
user_id: email,
callback_uri: absoluteUrl('/reset-password-callback')
Copy link
Collaborator

Choose a reason for hiding this comment

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

NOTE: If customers wanted to customize the callback URI they would have to come into this hook and change this line... Or should we have this configurable in the config file ?🤔

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