Skip to content

@W-17271709 Passwordless Login in Checkout#2178

Merged
hajinsuha1 merged 119 commits intofeature-passwordless-social-loginfrom
W-17271709-passwordless-login-in-checkout
Jan 22, 2025
Merged

@W-17271709 Passwordless Login in Checkout#2178
hajinsuha1 merged 119 commits intofeature-passwordless-social-loginfrom
W-17271709-passwordless-login-in-checkout

Conversation

@hajinsuha1
Copy link
Collaborator

@hajinsuha1 hajinsuha1 commented Dec 30, 2024

Description

Support the passwordless login flow when clicking the "Secure Link" button from the Checkout page.

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

  • send /oauth2/passwordless/login API call when clicking the "Secure Link" button on the Checkout page

How to Test-Drive This PR

  • Navigate to https://wasatch-mrt-passwordless-poc.mrt-storefront-staging.com/
  • Add an item to the cart and click Proceed to Checkout
  • Under Contact Info leave the email field blank and click the "Secure Link" button
    • Verify a Please enter your email address. error msg is displayed
  • Enter an invalid email like j.ha and click "Secure Link" button
    • Verify user is warned that an invalid email was entered
  • Enter your salesforce email and click the "Secure Link" button
    • Verify a Check Your Email confirmation pop-up modal is displayed
    • Click the Resend link button
  • Check your email and verify 2 "Your Magic Link to Login" emails were sent and click on the the magic link within one of the emails
  • Verify user is logged in and the cart still contains the item you added before 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)

yunakim714 and others added 30 commits October 31, 2024 14:47
…k-email-page

Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
…wordless-poc-mc

Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>

const isIdpValid = (name) => {
return name in IDP_CONFIG && IDP_CONFIG[name.toLowerCase()]
const formattedName = name.toLowerCase()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice I had this in my PR too!

const submitForm = async (data) => {
setError(null)
try {
if (isPasswordlessLoginClicked) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is okay because in the Auth modal and the Login pages, we also rely on a similar method to differentiate between the login methods.

If you wanted to keep the code consistent, we could use setLoginType as we do in those other login locations as so.

try {
if (isPasswordlessLoginClicked) {
await authorizePasswordlessLogin.mutateAsync({userid: data.email})
setAuthModalView(EMAIL_VIEW)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yup seems like we can add an a11y ticket for this... But non-blocking for release!

yunakim714 and others added 19 commits January 14, 2025 13:09
…m:SalesforceCommerceCloud/pwa-kit into W-17271709-passwordless-login-in-checkout
…eCommerceCloud/pwa-kit into W-17458039-handle-error-states
Base automatically changed from W-17458039-handle-error-states to feature-passwordless-social-login January 22, 2025 14:50
@hajinsuha1 hajinsuha1 merged commit 1b9aeb5 into feature-passwordless-social-login Jan 22, 2025
5 of 6 checks passed
@hajinsuha1 hajinsuha1 deleted the W-17271709-passwordless-login-in-checkout branch January 22, 2025 15:03
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.

4 participants