@W-20279798 support setting passwordless login mode in config#3492
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
…ition in authorizePasswordlessLogin
…out passwordless login
…ckURI in passwordless login
…nCallbackURI optional
…ode in login page
… commerce-sdk-react
…Commerce API parameters to test with staging-001
… update Commerce API parameters to test with staging-001" This reverts commit 0f3f211.
| organizationId, | ||
| shortCode, | ||
| siteId, | ||
| locale, |
There was a problem hiding this comment.
the locale that is passed to the authorizePasswordless endpoint is the one associated to the current site in config/sites.js
For example,
http://localhost:3000/us/ sets locale to en-US
http://localhost:3000/global sets locale to en-GB
http://localhost:3000/us/en-CA sets locale to en-CA
|
note I'll update the .hbs files in a separate ticket to keep the testing/changes small: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002QhntzYAB/view |
| const mode = parameters.mode || 'callback' | ||
| const callbackURI = parameters.callbackURI || this.passwordlessLoginCallbackURI | ||
| const finalMode = callbackURI ? 'callback' : parameters.mode || 'sms' | ||
| const locale = this.locale |
There was a problem hiding this comment.
simplified mode selection to respect user's explicit mode choice while still defaulting to callback mode for backward compatibility
|
When clicking on the link after initiating passwordless login in en-US, it goes to the en-GB passwordless login landing page. It may be beneficial for the locale to be included in the link in the template, so the language stays consistent. Unfortunately it seems currently the template API in SLAS uses the same link for all locales, making it difficult to have a unique link with the Also, if we're going to use the way of including /global/{locale} in the link to make the language consistent, I think I'm noticing an issue in PWA Kit where the call to |
…, update Commerce API parameters to test with staging-001" This reverts commit 66bcafa.
…for localized paths
@jeremy-jung1 Thanks for catching this!
This can be tested on this deployed instance: |
…ail mode, update Commerce API parameters to test with staging-001"" This reverts commit 465b813.
…wordless-login-mode-in-config
jeremy-jung1
left a comment
There was a problem hiding this comment.
Followed the test steps and things are working as expected
Description
Added a new
modeto the passwordless configuration that allows merchants to configure the mode they want to use for alloauth/passwordless/logincalls:Now it will set the passwordless login mode to the following
Types of Changes
Changes
localeto Auth objectauthorizePasswordlessto pass locale and simplify mode selection to respect user's explicit mode choice while still defaulting to callback mode for backward compatibilityHow to Test-Drive This PR
Email mode
This tests when default.js is configured to the following:
template-retail-react-appContinue Securelybutton after entering your email to trigger passwordless loginCheck your emailscreen is shownen-USinstead ofen-GB)Callback mode
default.jstoContinue Securelybutton after entering your email to trigger passwordless loginCheck your emailscreen is shownBackwards Compatibilty with
template-retail-react-appThe current
template-retail-react-appdoes not specify amodeand only specifies acallbackURI. Let's make sure our changes incommerce-sdk-reactare backwards compatible!This ensures when mode is missing but callbackURI is set in default.js, callback mode is used
commerce-sdk-reactchanges and sets uptemplate-retail-react-appwith a private client and start the appContinue Securelybutton after entering your email to trigger passwordless loginCheck your emailscreen is shownChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization