Skip to content

Commit 228a14f

Browse files
author
joel-uong_sfemu
committed
Sync from monorepo
Template version: 1.1.0-dev Uses bundled workspace packages (not yet on NPM) Synced by: joel-uong_sfemu Monorepo SHA: f50c8d657a5a28b9a5dd8a0f59ceecb431993ec7 Latest change: f50c8d657 - Fix: Tolerate OTP length mismatch at verify modal (@W-22454318@) (#1903)
1 parent 4666cf3 commit 228a14f

19 files changed

Lines changed: 375 additions & 332 deletions

docs/README-CONFIG-OPTIONS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ The length of the OTP (One-Time Password) code used for authentication. This val
597597

598598
**Important:** This is a global setting that affects all authentication flows. SLAS enforces a single OTP length for all auth features, so this value should remain consistent across your application.
599599

600+
`otpLength` sets the OTP modal's initial slot count, but it does not control the length SLAS actually delivers — keep it matched to your SLAS client. The modal tolerates a mismatch so a configuration drift never strands the shopper: pasting a code longer than `otpLength` expands the inputs to fit (up to the 8-digit maximum SLAS issues), and the modal accepts any 6-to-8-digit code. Match this value to your SLAS client anyway so the default slot count and the "we sent an N-digit code" copy are correct.
601+
600602
Example:
601603
```bash
602604
PUBLIC__app__auth__otpLength=6

docs/README-EMAIL-VERIFICATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ When email verification is **enabled**, the post-order registration card is not
111111
| --- | --- | --- |
112112
| OTP not delivered (email mode) | Sender email not configured in SLAS; password action email template not set | Verify SLAS email configuration |
113113
| OTP not delivered (callback mode) | `callbackUri` not allowlisted or endpoint unreachable | Ensure `callbackUri` exactly matches an allowlisted URL in the SLAS client (full URL, no wildcards); confirm the endpoint is publicly accessible |
114-
| OTP has wrong number of digits | `auth.otpLength` in `config.server.ts` doesn't match the SLAS client OTP length | Set `auth.otpLength` to `6` or `8` to match your SLAS private client configuration |
114+
| OTP modal shows the wrong number of input slots for the delivered code | `auth.otpLength` in `config.server.ts` doesn't match the SLAS client OTP length. SLAS owns the delivered length; `otpLength` only sets the modal's initial slot count. | Set `auth.otpLength` to `6` or `8` to match your SLAS private client so the slot count and copy are correct. The modal tolerates a mismatch regardless: pasting a code longer than `otpLength` expands the inputs to fit (up to 8) and auto-submits, and any 6-to-8-digit code can also be submitted via the **Verify** button — so a drift no longer hard-blocks login. (A code longer than `otpLength` that is *typed by hand* rather than pasted won't expand the inputs; paste it, or correct the config.) |
115115
| Passwordless registration form not shown | "Enable Email Verification" site preference is off | Enable the preference in Business Manager; allow up to 5 minutes to propagate |
116116
| Verification badge or "Change Email" button missing | "Enable Email Verification" is off or hasn't propagated | Enable the preference; allow up to 5 minutes to propagate |
117117
| Shopper can't log in after email update | "Enable Loginid Updates for SCAPI" is not enabled — SCAPI accepts the email change but doesn't sync the login ID | Contact Salesforce support to enable "Enable Loginid Updates for SCAPI" |

packages/storefront-next-runtime/dist/config.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { n as Site, r as Url, t as Locale } from "./types.js";
22
import { n as DefineConfigOptions, r as defineConfig, t as BaseConfig } from "./schema.js";
33
import { ReactNode } from "react";
44
import * as react_jsx_runtime2 from "react/jsx-runtime";
5-
import * as react_router5 from "react-router";
5+
import * as react_router15 from "react-router";
66
import { RouterContextProvider } from "react-router";
77

88
//#region src/config/context.d.ts
@@ -22,7 +22,7 @@ interface AppConfigShape {
2222
* app-config middleware; read via `context.get(appConfigContext)` in loaders,
2323
* actions, and other middleware. Returns the augmented `AppConfigShape`.
2424
*/
25-
declare const appConfigContext: react_router5.RouterContext<AppConfigShape>;
25+
declare const appConfigContext: react_router15.RouterContext<AppConfigShape>;
2626
interface ConfigProviderProps {
2727
config: AppConfigShape;
2828
children: ReactNode;

packages/storefront-next-runtime/dist/config.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/storefront-next-runtime/dist/data-store.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as react_router6 from "react-router";
1+
import * as react_router8 from "react-router";
22
import { MiddlewareFunction, RouterContextProvider, createContext } from "react-router";
33
import { DataStore, DataStoreNotFoundError, DataStoreServiceError, DataStoreUnavailableError } from "@salesforce/mrt-utilities/data-store";
44

@@ -157,7 +157,7 @@ interface DataStoreLogger {
157157
* Defaults to `null` (not `undefined`) because React Router's
158158
* `context.get()` throws when `defaultValue === undefined`.
159159
*/
160-
declare const dataStoreLoggerContext: react_router6.RouterContext<DataStoreLogger | null>;
160+
declare const dataStoreLoggerContext: react_router8.RouterContext<DataStoreLogger | null>;
161161
/**
162162
* Read the data-store logger from router context, falling back to a
163163
* console-based default when nothing has been injected.
@@ -234,7 +234,7 @@ type LoginPreferences = {
234234
declare function getLoginPreferences(context: Readonly<RouterContextProvider>): LoginPreferences;
235235
//#endregion
236236
//#region src/data-store/index.d.ts
237-
declare const dataStoreMiddleware: react_router6.MiddlewareFunction<Response>[];
237+
declare const dataStoreMiddleware: react_router8.MiddlewareFunction<Response>[];
238238
//#endregion
239239
export { type CustomGlobalPreferences, DataStore, type DataStoreContextKey, type DataStoreEntry, type DataStoreEntryKey, type DataStoreLogger, type DataStoreMiddlewareOptions, DataStoreNotFoundError, DataStoreServiceError, DataStoreUnavailableError, type GcpPreferences, type LoginPreferences, type SitePreferences, createDataStoreContext, createDataStoreMiddleware, createLazyDataStoreMiddleware, dataStoreLoggerContext, dataStoreMiddleware, getCustomGlobalPreferences, getDataStoreEntry, getDataStoreLogger, getGcpApiKey, getGcpPreferences, getLoginPreferences, getSitePreferences, readLazyDataStoreEntry };
240240
//# sourceMappingURL=data-store.d.ts.map

packages/storefront-next-runtime/dist/data-store.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/storefront-next-runtime/dist/scapi.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/storefront-next-runtime/dist/security.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as react_router15 from "react-router";
1+
import * as react_router14 from "react-router";
22
import { MiddlewareFunction, RouterContextProvider } from "react-router";
33

44
//#region src/security/types.d.ts
@@ -135,7 +135,7 @@ declare const defaultSecurityHeaders: ResolvedSecurityConfig;
135135
//#endregion
136136
//#region src/security/nonce.d.ts
137137
/** React Router context carrying the current request's CSP nonce. */
138-
declare const securityContext: react_router15.RouterContext<{
138+
declare const securityContext: react_router14.RouterContext<{
139139
nonce: string;
140140
} | null>;
141141
/**

packages/storefront-next-runtime/dist/site-context.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { n as Site$1, r as Url, t as Locale$1 } from "./types.js";
22
import { PropsWithChildren } from "react";
33
import * as react_jsx_runtime0 from "react/jsx-runtime";
4-
import * as react_router1 from "react-router";
4+
import * as react_router10 from "react-router";
55
import { Cookie, CookieOptions, MiddlewareFunction, RouterContextProvider } from "react-router";
66
import { RouteConfigEntry } from "@react-router/dev/routes";
77

@@ -198,7 +198,7 @@ declare function buildUrl({
198198
}): string;
199199
//#endregion
200200
//#region src/site-context/middleware.d.ts
201-
declare const siteContext: react_router1.RouterContext<SiteContext | null>;
201+
declare const siteContext: react_router10.RouterContext<SiteContext | null>;
202202
/**
203203
* Resolved site context result from {@link resolveSiteContext}.
204204
*/
@@ -246,9 +246,9 @@ declare function resolveSiteContext(request: Request, settings: SiteSettings): P
246246
* ```
247247
*/
248248
declare function getSiteContextCookies(context: Readonly<RouterContextProvider>): {
249-
siteCookie: react_router1.Cookie;
250-
localeCookie: react_router1.Cookie;
251-
currencyCookie: react_router1.Cookie;
249+
siteCookie: react_router10.Cookie;
250+
localeCookie: react_router10.Cookie;
251+
currencyCookie: react_router10.Cookie;
252252
} | null;
253253
/**
254254
* Creates a site context middleware that resolves the current site from

packages/storefront-next-runtime/dist/site-context.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)