doct-ui-auth-kit 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-form-state-persistence.d.ts +20 -0
- package/dist/index.js +674 -671
- package/dist/pages.js +1 -1
- package/dist/{signup-page-DlKFcIGU.js → signup-page-C4ccMx69.js} +528 -470
- package/dist/utils/form-state-storage.d.ts +27 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sessionStorage` persistence for the auth-flow form values. Survives
|
|
3
|
+
* back-button navigation between auth steps (PHONE_ENTRY → OTP → back)
|
|
4
|
+
* so the user doesn't have to re-type their phone / email / name.
|
|
5
|
+
*
|
|
6
|
+
* Cleared on successful auth (the provider watches
|
|
7
|
+
* `state.step === 'AUTHENTICATED'` and calls `clearAllFormState()`) and
|
|
8
|
+
* automatically when the tab closes (sessionStorage default behaviour).
|
|
9
|
+
*
|
|
10
|
+
* OTP digits are deliberately NOT persisted — they're single-use and
|
|
11
|
+
* time-sensitive, so the OTP page never wires this in.
|
|
12
|
+
*
|
|
13
|
+
* All functions are SSR-safe and silent on storage failures (private
|
|
14
|
+
* browsing modes can throw on access; quota errors on write).
|
|
15
|
+
*/
|
|
16
|
+
/** Read a stored form snapshot. Returns null when missing or unparseable. */
|
|
17
|
+
export declare function readFormState<T>(key: string): T | null;
|
|
18
|
+
/** Persist a form snapshot. No-op on quota exceeded / disabled storage. */
|
|
19
|
+
export declare function writeFormState<T>(key: string, value: T): void;
|
|
20
|
+
/** Clear one form's snapshot. */
|
|
21
|
+
export declare function clearFormState(key: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Wipe every kit-persisted form snapshot. Called on successful auth so
|
|
24
|
+
* the next session starts from a clean slate (no stale phone/email
|
|
25
|
+
* pre-filled into a fresh login).
|
|
26
|
+
*/
|
|
27
|
+
export declare function clearAllFormState(): void;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* Reusable utilities used in 2+ places across the auth SDK.
|
|
3
3
|
*/
|
|
4
4
|
export { buildPhoneRecipient } from './build-phone-recipient';
|
|
5
|
+
export { clearAllFormState, clearFormState, readFormState, writeFormState, } from './form-state-storage';
|
|
5
6
|
export { setFormErrorsFromZod } from './set-form-errors-from-zod';
|
package/package.json
CHANGED