Skip to content

Feature passwordless social login#2079

Merged
vmarta merged 74 commits intodevelopfrom
feature-passwordless-social-login
Feb 12, 2025
Merged

Feature passwordless social login#2079
vmarta merged 74 commits intodevelopfrom
feature-passwordless-social-login

Conversation

@hajinsuha1
Copy link
Collaborator

@hajinsuha1 hajinsuha1 commented Oct 15, 2024

Description

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 new login configuration in template-retail-react-app/config/default.js
  • Revamp the current reset password flow to utilize SLAS API's
  • Add OOTB social login functionality via Google & Apple IDP's
  • Add passwordless login functionality with email send via Marketing Cloud

How to Test-Drive This PR

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)

bredmond-sf and others added 27 commits September 25, 2024 15:32
…orceCommerceCloud/pwa-kit into W-16544327-social-login-ui
…orceCommerceCloud/pwa-kit into feature-passwordless-social-login
Add wrappers for social login helpers: `authorizeIDP` and `loginIDPUser`
---------
Co-authored-by: Joel Uong <88680517+joeluong-sfcc@users.noreply.github.com>
Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
…2075)

* Add `authorizePasswordless` and `getPasswordLessAccessToken` wrappers to `commerce-sdk-react`
* Add `callbackURI` to Auth class and `CommerceApiProvider`

---------

Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
This PR implements the Social Login redirect page which has a loading state until the user is successfully logged in.
Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
* add StandardLogin, PasswordlessLogin, SocialLogin components
Implement a Check Your Email page that will be used in the passwordless login flow

---------

Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
…ge (#2105)

Add passwordless/social login UI buttons to the Checkout page if enabled.

---------

Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
Co-authored-by: Jinsu Ha <j.ha@salesforce.com>
Co-authored-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
Signed-off-by: Jinsu Ha <91205717+hajinsuha1@users.noreply.github.com>
…to UI (#2124)

Integrate Social Login UI changes in the PWA Kit to backend SLAS API calls.
---------

Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
* make passwordless login work by sending an email via a Marketing Cloud integration

* add new check email page

* make passwordless login work in auth-modal

* create use-passwordless-login hook and support passwordless in /login page

* add /passwordless-login-landing page

* add /reset-password-landing page

* call mergeBasket during passwordless login
yunakim714 and others added 2 commits January 14, 2025 17:53
…r social/passwordless login & reset password (#2198)

Customers can change the callback & redirect uri's for social login, passwordless login, and password reset via env var
@vmarta
Copy link
Contributor

vmarta commented Feb 6, 2025

I think after the latest changes to commerce-sdk-isomophic released, we may still see some tests failing.

I've built and copied the commerce-sdk-isomorphic with the latest changes. Then I ran npm run test with the retail-react-app and commerce-sdk-react packages. Maybe it's just me, but I'm seeing some errors like this:

Ghostty 2025-02-05 at 18 53 01

Copy link
Contributor

@vmarta vmarta left a comment

Choose a reason for hiding this comment

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

Some thoughts for now..

Comment on lines +16 to +22
'module-resolver',
{
'root': ['./'],
'alias': {
'@salesforce/retail-react-app': './'
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, thanks for fixing the module-not-found issue.

Comment on lines +1238 to +1239
// TODO: no code verifier needed with the fix blair has made, delete this when the fix has been merged to production
// @ts-ignore
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO: Delete this when SLAS has been released!

Copy link
Collaborator

Choose a reason for hiding this comment

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

@vmarta This RAML change is being published tomorrow, so will not be included in the latest isomorphic release. I will need to add an eslint comment above this so that the lint step does not fail for commerces-sdk-react

Copy link
Contributor

Choose a reason for hiding this comment

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

@yunakim714 I've added the eslint ignore comment in the feature branch

Comment on lines +62 to +63
applySLASPrivateClientToEndpoints:
/oauth2\/(token|passwordless|password\/(login|token|reset|action))/,
/oauth2\/(token|authorize|passwordless\/(login|token)|password\/(reset|action))/,
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we're supporting passwordless login, social login, etc, I think we should have this regex as the default. In other words, the value for applySLASPrivateClientToEndpoints should be in the pwa-kit-runtime and not here in the retail-react-app template.

applySLASPrivateClientToEndpoints: /\/oauth2\/token/

Having it in the runtime will be an easier change to consume by the customers. Otherwise, how would they know to update their existing project such that it configures the applySLASPrivateClientToEndpoints option?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vcua-mobify since you originally wrote the code for applySLASPrivateClientToEndpoints, what should we do in this case? ^

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 with @vmarta

applySLASPrivateClientToEndpoints can be overridden by defining a applySLASPrivateClientToEndpoints inside the options object in ssr.js but since these will be a default supported endpoint, let's update the endpoint in the runtime

@vmarta
Copy link
Contributor

vmarta commented Feb 7, 2025

For further commits/changes, can we create a separate PR please? It would be easier to track the changes that way.

yunakim714 and others added 7 commits February 10, 2025 16:00
* Remove initial fetch to improve performance and fix bugs
Add DNT to `loginIDPUser` and `getPasswordLessAccessToken` wrappers. Skip Social Login E2E test for now as Playwright cannot get past Google 2FA.

---------

Signed-off-by: Yuna Kim <84923642+yunakim714@users.noreply.github.com>
Co-authored-by: Vincent Marta <vmarta@salesforce.com>
vmarta and others added 3 commits February 12, 2025 11:00
…ints` (#2250)

* Move applySLASPrivateClientToEndpoints to pwa-kit-runtime

The change will be easier to consume than if it's in the template.

* Authorize endpoint do not need the authorization header

Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com>
Signed-off-by: Vincent Marta <vmarta@gmail.com>

* Minor cleanup

---------

Signed-off-by: Vincent Marta <vmarta@gmail.com>
Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com>
@vmarta vmarta merged commit 2cb9c0e into develop Feb 12, 2025
35 checks passed
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.

7 participants