@passflow/react 0.16.0 → 0.18.0
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/CHANGELOG.md +36 -0
- package/README.md +42 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +146 -133
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
- package/dist/src/components/form/reset-password/index.d.cts +2 -0
- package/dist/src/components/form/reset-password/index.d.ts +2 -0
- package/dist/src/components/form/reset-password/index.d.ts.map +1 -1
- package/dist/src/components/form/signin/index.d.ts.map +1 -1
- package/dist/src/components/form/signup/index.d.ts.map +1 -1
- package/dist/src/components/provider/passflow-provider.d.cts +1 -0
- package/dist/src/components/provider/passflow-provider.d.ts +1 -0
- package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
- package/dist/src/components/provider/use-dispose-on-replace.d.cts +17 -0
- package/dist/src/components/provider/use-dispose-on-replace.d.ts +17 -0
- package/dist/src/components/provider/use-dispose-on-replace.d.ts.map +1 -0
- package/dist/src/components/ui/button/index.d.ts.map +1 -1
- package/dist/src/components/ui/fields/field-otp.d.cts +3 -1
- package/dist/src/components/ui/fields/field-otp.d.ts +3 -1
- package/dist/src/components/ui/fields/field-otp.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/email-code.d.cts +10 -0
- package/dist/src/components/ui/login-screen/email-code.d.ts +10 -0
- package/dist/src/components/ui/login-screen/email-code.d.ts.map +1 -0
- package/dist/src/components/ui/login-screen/index.d.cts +1 -1
- package/dist/src/components/ui/login-screen/index.d.ts +1 -1
- package/dist/src/components/ui/login-screen/index.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/login-screen.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/new-password.d.cts +10 -0
- package/dist/src/components/ui/login-screen/new-password.d.ts +10 -0
- package/dist/src/components/ui/login-screen/new-password.d.ts.map +1 -0
- package/dist/src/components/ui/login-screen/status.d.ts.map +1 -1
- package/dist/src/components/ui/login-screen/types.d.cts +62 -3
- package/dist/src/components/ui/login-screen/types.d.ts +62 -3
- package/dist/src/components/ui/login-screen/types.d.ts.map +1 -1
- package/dist/src/context/auth-context.d.cts +5 -4
- package/dist/src/context/auth-context.d.ts +5 -4
- package/dist/src/context/auth-context.d.ts.map +1 -1
- package/dist/src/hooks/index.d.cts +3 -1
- package/dist/src/hooks/index.d.ts +3 -1
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/use-email-code-step.d.cts +39 -0
- package/dist/src/hooks/use-email-code-step.d.ts +39 -0
- package/dist/src/hooks/use-email-code-step.d.ts.map +1 -0
- package/dist/src/hooks/use-join-invite.d.ts.map +1 -1
- package/dist/src/hooks/use-refresh-status.d.cts +36 -0
- package/dist/src/hooks/use-refresh-status.d.ts +36 -0
- package/dist/src/hooks/use-refresh-status.d.ts.map +1 -0
- package/dist/src/hooks/use-reset-password.d.cts +14 -1
- package/dist/src/hooks/use-reset-password.d.ts +14 -1
- package/dist/src/hooks/use-reset-password.d.ts.map +1 -1
- package/dist/src/hooks/use-session-expired.d.cts +8 -4
- package/dist/src/hooks/use-session-expired.d.ts +8 -4
- package/dist/src/hooks/use-session-expired.d.ts.map +1 -1
- package/dist/src/hooks/use-signin.d.cts +6 -0
- package/dist/src/hooks/use-signin.d.ts +6 -0
- package/dist/src/hooks/use-signin.d.ts.map +1 -1
- package/dist/src/hooks/use-signup.d.cts +6 -0
- package/dist/src/hooks/use-signup.d.ts +6 -0
- package/dist/src/hooks/use-signup.d.ts.map +1 -1
- package/dist/src/index.d.cts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/email-verification.d.cts +18 -0
- package/dist/src/types/email-verification.d.ts +18 -0
- package/dist/src/types/email-verification.d.ts.map +1 -0
- package/dist/src/types/index.d.cts +1 -0
- package/dist/src/types/index.d.ts +1 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/utils/auth-error.d.cts +46 -0
- package/dist/src/utils/auth-error.d.ts +46 -0
- package/dist/src/utils/auth-error.d.ts.map +1 -1
- package/dist/src/utils/email-verification.d.cts +44 -0
- package/dist/src/utils/email-verification.d.ts +44 -0
- package/dist/src/utils/email-verification.d.ts.map +1 -0
- package/dist/src/utils/get-url-errors.d.ts.map +1 -1
- package/dist/src/utils/index.d.cts +2 -1
- package/dist/src/utils/index.d.ts +2 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/passflow/index.tsx"],"names":[],"mappings":"AAeA,OAAO,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAOL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAOlB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,YAAY,IAAI,oBAAoB,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEhH,KAAK,iBAAiB,GAAG;IACvB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CACI;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;CACxB,CACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/flow/passflow/index.tsx"],"names":[],"mappings":"AAeA,OAAO,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAOL,KAAK,YAAY,EAEjB,KAAK,YAAY,EAOlB,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,YAAY,IAAI,oBAAoB,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEhH,KAAK,iBAAiB,GAAG;IACvB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CACI;IACE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE;;;;;OAKG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;CACxB,CACJ,CAAC;AA8OJ,eAAO,MAAM,YAAY,8DAA6C,CAAC"}
|
|
@@ -3,6 +3,8 @@ import type { SuccessAuthRedirect } from '../../../types/index.cjs';
|
|
|
3
3
|
type TResetPassword = {
|
|
4
4
|
successAuthRedirect?: SuccessAuthRedirect;
|
|
5
5
|
twoFactorVerifyPath?: string;
|
|
6
|
+
/** Where `Back to sign in` goes once the password is saved. */
|
|
7
|
+
signInPath?: string;
|
|
6
8
|
};
|
|
7
9
|
export declare const ResetPassword: FC<TResetPassword>;
|
|
8
10
|
export {};
|
|
@@ -3,6 +3,8 @@ import type { SuccessAuthRedirect } from '../../../types/index.js';
|
|
|
3
3
|
type TResetPassword = {
|
|
4
4
|
successAuthRedirect?: SuccessAuthRedirect;
|
|
5
5
|
twoFactorVerifyPath?: string;
|
|
6
|
+
/** Where `Back to sign in` goes once the password is saved. */
|
|
7
|
+
signInPath?: string;
|
|
6
8
|
};
|
|
7
9
|
export declare const ResetPassword: FC<TResetPassword>;
|
|
8
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/reset-password/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/reset-password/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,oBAAoB,CAAC;AAM5B,KAAK,cAAc,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAWF,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,cAAc,CA8G5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signin/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signin/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAchC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAkDnD,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,OAAO,CA0OlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signup/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signup/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAchC,OAAO,KAAK,EAAiB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAsDlE,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,OAAO,CAwNlC,CAAC;AAEF,eAAO,MAAM,MAAM,wDAAwC,CAAC"}
|
|
@@ -57,6 +57,7 @@ type PassflowProviderProps = PassflowConfig & {
|
|
|
57
57
|
* - /auth/passwordless/* — OTP / magic-link start+complete
|
|
58
58
|
* - /auth/passkey/* — passkey registration/auth
|
|
59
59
|
* - /auth/2fa/* — second-factor verify
|
|
60
|
+
* - /auth/validate — emailed sign-up / sign-in code
|
|
60
61
|
* - /auth/federated/start — federated start (callback is server)
|
|
61
62
|
* - /auth/session/exchange — RFC 8693-style session exchange
|
|
62
63
|
* (ADR-2; activated on Leg 2 of
|
|
@@ -57,6 +57,7 @@ type PassflowProviderProps = PassflowConfig & {
|
|
|
57
57
|
* - /auth/passwordless/* — OTP / magic-link start+complete
|
|
58
58
|
* - /auth/passkey/* — passkey registration/auth
|
|
59
59
|
* - /auth/2fa/* — second-factor verify
|
|
60
|
+
* - /auth/validate — emailed sign-up / sign-in code
|
|
60
61
|
* - /auth/federated/start — federated start (callback is server)
|
|
61
62
|
* - /auth/session/exchange — RFC 8693-style session exchange
|
|
62
63
|
* (ADR-2; activated on Leg 2 of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/passflow-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,cAAc,EAA2B,MAAM,gBAAgB,CAAC;AAC7G,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiE,MAAM,OAAO,CAAC;AACtH,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"passflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/passflow-provider.tsx"],"names":[],"mappings":"AAA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MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;;;;;;GAMG;AACH,KAAK,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,CAAC;AAmLtF;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;CAC9B,CAAC;AAwCF,eAAO,MAAM,mBAAmB,yCAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0JtD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Passflow } from '@passflow/core';
|
|
2
|
+
type Disposable = Pick<Passflow, 'dispose'>;
|
|
3
|
+
/**
|
|
4
|
+
* Disposes a Passflow instance once it is replaced (a new `useMemo` value) or the
|
|
5
|
+
* provider unmounts. Each instance owns refresh timers, a BroadcastChannel and Web
|
|
6
|
+
* Locks; one left undisposed keeps acting as an extra tab.
|
|
7
|
+
*
|
|
8
|
+
* Why the dispose is deferred: React StrictMode runs effect cleanup and setup again
|
|
9
|
+
* for the same instance in one commit, while `useMemo` keeps that instance live. An
|
|
10
|
+
* immediate dispose in cleanup would kill the instance the app keeps using, and core
|
|
11
|
+
* forbids using an instance after `dispose()`. So cleanup only schedules the dispose
|
|
12
|
+
* (`setTimeout(0)`); a setup that sees the same instance cancels it. A different
|
|
13
|
+
* instance or a real unmount leaves the timer to fire.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useDisposeOnReplace(instance: Disposable): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=use-dispose-on-replace.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Passflow } from '@passflow/core';
|
|
2
|
+
type Disposable = Pick<Passflow, 'dispose'>;
|
|
3
|
+
/**
|
|
4
|
+
* Disposes a Passflow instance once it is replaced (a new `useMemo` value) or the
|
|
5
|
+
* provider unmounts. Each instance owns refresh timers, a BroadcastChannel and Web
|
|
6
|
+
* Locks; one left undisposed keeps acting as an extra tab.
|
|
7
|
+
*
|
|
8
|
+
* Why the dispose is deferred: React StrictMode runs effect cleanup and setup again
|
|
9
|
+
* for the same instance in one commit, while `useMemo` keeps that instance live. An
|
|
10
|
+
* immediate dispose in cleanup would kill the instance the app keeps using, and core
|
|
11
|
+
* forbids using an instance after `dispose()`. So cleanup only schedules the dispose
|
|
12
|
+
* (`setTimeout(0)`); a setup that sees the same instance cancels it. A different
|
|
13
|
+
* instance or a real unmount leaves the timer to fire.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useDisposeOnReplace(instance: Disposable): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=use-dispose-on-replace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-dispose-on-replace.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/use-dispose-on-replace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,KAAK,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAO5C;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI,CAe9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/button/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,EAAE,EAGP,KAAK,iBAAiB,EAG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EAAE,CAAC,WAAW,CASlC,CAAC;AAEF,KAAK,OAAO,GAAG,iBAAiB,GAC9B,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACxC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACjC;;OAEG;IACH,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9G,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,OAAO,CA2F9B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
1
|
+
import type { FC, Ref } from 'react';
|
|
2
2
|
export type FieldOtpCharset = 'numeric' | 'alphanumeric';
|
|
3
3
|
export type FieldOtpState = 'default' | 'error' | 'disabled';
|
|
4
4
|
type FieldOtpBaseProps = {
|
|
@@ -19,6 +19,8 @@ type FieldOtpBaseProps = {
|
|
|
19
19
|
/** Id of the element that describes it, such as the error message. */
|
|
20
20
|
describedBy?: string;
|
|
21
21
|
autoFocus?: boolean;
|
|
22
|
+
/** The one real `<input>`, so a screen can return focus to it after the field was locked. */
|
|
23
|
+
ref?: Ref<HTMLInputElement>;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* The code field is named either by a visible label it draws itself (`label`),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
1
|
+
import type { FC, Ref } from 'react';
|
|
2
2
|
export type FieldOtpCharset = 'numeric' | 'alphanumeric';
|
|
3
3
|
export type FieldOtpState = 'default' | 'error' | 'disabled';
|
|
4
4
|
type FieldOtpBaseProps = {
|
|
@@ -19,6 +19,8 @@ type FieldOtpBaseProps = {
|
|
|
19
19
|
/** Id of the element that describes it, such as the error message. */
|
|
20
20
|
describedBy?: string;
|
|
21
21
|
autoFocus?: boolean;
|
|
22
|
+
/** The one real `<input>`, so a screen can return focus to it after the field was locked. */
|
|
23
|
+
ref?: Ref<HTMLInputElement>;
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
24
26
|
* The code field is named either by a visible label it draws itself (`label`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-otp.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-otp.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"field-otp.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/fields/field-otp.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,cAAc,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAE7D,KAAK,iBAAiB,GAAG;IACvB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,2FAA2F;IAC3F,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,+FAA+F;IAC/F,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6FAA6F;IAC7F,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,CACI;IACE,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,GACD;IACE,oGAAoG;IACpG,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CACJ,CAAC;AAsBJ;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CA0DtC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { LoginEmailCodeState } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* The emailed verification code step: the server's prompt names a row of code
|
|
5
|
+
* boxes; six digits submit by themselves. A failed verify or a resend clears the
|
|
6
|
+
* typed code. While a verify is in flight the code, Resend and the way back are
|
|
7
|
+
* locked, and focus returns to the code when it ends.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LoginEmailCode: FC<LoginEmailCodeState>;
|
|
10
|
+
//# sourceMappingURL=email-code.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { LoginEmailCodeState } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The emailed verification code step: the server's prompt names a row of code
|
|
5
|
+
* boxes; six digits submit by themselves. A failed verify or a resend clears the
|
|
6
|
+
* typed code. While a verify is in flight the code, Resend and the way back are
|
|
7
|
+
* locked, and focus returns to the code when it ends.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LoginEmailCode: FC<LoginEmailCodeState>;
|
|
10
|
+
//# sourceMappingURL=email-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-code.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/email-code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;AAM3C,OAAO,KAAK,EAAwB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmEzE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAgGlD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { LoginScreen } from './login-screen.cjs';
|
|
2
2
|
export { LoginAlert } from './shared.cjs';
|
|
3
|
-
export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginPasskeyProgressState, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.cjs';
|
|
3
|
+
export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginEmailCodeResend, LoginEmailCodeState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginNewPasswordState, LoginPasskeyProgressState, LoginScreenAction, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.cjs';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { LoginScreen } from './login-screen.js';
|
|
2
2
|
export { LoginAlert } from './shared.js';
|
|
3
|
-
export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginPasskeyProgressState, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.js';
|
|
3
|
+
export type { LoginCodeEntryState, LoginConsentScope, LoginConsentState, LoginCredentialsState, LoginCredentialsValues, LoginDeviceApprovalState, LoginEmailCodeResend, LoginEmailCodeState, LoginGeneralErrorState, LoginIdentityMethod, LoginInvitationState, LoginMethodConfig, LoginNewPasswordState, LoginPasskeyProgressState, LoginScreenAction, LoginScreenChrome, LoginScreenLink, LoginScreenNotice as LoginScreenNoticeProps, LoginScreenProps, LoginScreenState, LoginSecondFactorMethod, LoginSecondFactorState, LoginStatusState, } from './types.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,IAAI,sBAAsB,EAC3C,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,IAAI,sBAAsB,EAC3C,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-screen.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/login-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"login-screen.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/login-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAahC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAmD5C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { LoginNewPasswordState } from './types.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Choosing a new password, checked against the app's password policy as it is
|
|
5
|
+
* typed: for a reset, or to finish an account started by email. The field keeps
|
|
6
|
+
* `id="password"`, and the button the `passflow-button-reset-password` class, so an
|
|
7
|
+
* app's custom CSS still finds them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LoginNewPassword: FC<LoginNewPasswordState>;
|
|
10
|
+
//# sourceMappingURL=new-password.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { LoginNewPasswordState } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Choosing a new password, checked against the app's password policy as it is
|
|
5
|
+
* typed: for a reset, or to finish an account started by email. The field keeps
|
|
6
|
+
* `id="password"`, and the button the `passflow-button-reset-password` class, so an
|
|
7
|
+
* app's custom CSS still finds them.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LoginNewPassword: FC<LoginNewPasswordState>;
|
|
10
|
+
//# sourceMappingURL=new-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-password.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/new-password.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAOrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAoFtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAyC5C,CAAC"}
|
|
@@ -3,7 +3,11 @@ import type { AuthUiError, DefaultMethod } from '../../../types/index.cjs';
|
|
|
3
3
|
export type LoginScreenChrome = {
|
|
4
4
|
title: string;
|
|
5
5
|
subtitle?: string;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* `sign-in` and `reset-password` keep the wrapper class (`passflow-signin-wrapper`,
|
|
8
|
+
* `passflow-reset-password-wrapper`) that an app's custom CSS may target.
|
|
9
|
+
*/
|
|
10
|
+
variant?: 'sign-in' | 'reset-password';
|
|
7
11
|
customCss?: string;
|
|
8
12
|
customLogo?: string;
|
|
9
13
|
customLogoAlt?: string;
|
|
@@ -80,6 +84,60 @@ export type LoginCodeEntryState = {
|
|
|
80
84
|
testId?: string;
|
|
81
85
|
onSubmit: (code: string) => void;
|
|
82
86
|
};
|
|
87
|
+
/** The resend control of the emailed-code step. Omitted when the code cannot be sent again. */
|
|
88
|
+
export type LoginEmailCodeResend = {
|
|
89
|
+
/** Seconds the control waits before it can be pressed. Default 30; restarts on every press and on `restartKey` change. */
|
|
90
|
+
cooldownSeconds?: number;
|
|
91
|
+
/** Changes when a new code was sent (pass the challenge id): restarts the cooldown and clears the typed code. */
|
|
92
|
+
restartKey?: string;
|
|
93
|
+
/** A resend is in flight. */
|
|
94
|
+
busy?: boolean;
|
|
95
|
+
/** Default `Resend code`. */
|
|
96
|
+
label?: string;
|
|
97
|
+
onResend: () => void;
|
|
98
|
+
};
|
|
99
|
+
/** The way back out of the step, such as `Use a different email` or `Back to sign in`. */
|
|
100
|
+
export type LoginScreenAction = {
|
|
101
|
+
label: string;
|
|
102
|
+
onClick: () => void;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The emailed verification code step: the server's prompt, a row of code boxes,
|
|
106
|
+
* Verify, Resend and a way back.
|
|
107
|
+
*/
|
|
108
|
+
export type LoginEmailCodeState = {
|
|
109
|
+
kind: 'email-code';
|
|
110
|
+
/** The server's prompt, such as "We sent a code to a***@example.com."; it also names the code field. */
|
|
111
|
+
message: string;
|
|
112
|
+
/** Digits in the code. Default 6. */
|
|
113
|
+
length?: number;
|
|
114
|
+
/** The server's answer to a failed verify or resend; clears the typed code. */
|
|
115
|
+
error?: string | null;
|
|
116
|
+
/** A verify is in flight: the code, Resend and the way back are locked. */
|
|
117
|
+
busy?: boolean;
|
|
118
|
+
/** Default `Verify`. */
|
|
119
|
+
submitLabel?: string;
|
|
120
|
+
resend?: LoginEmailCodeResend;
|
|
121
|
+
secondaryAction?: LoginScreenAction;
|
|
122
|
+
testId?: string;
|
|
123
|
+
onSubmit: (code: string) => void;
|
|
124
|
+
};
|
|
125
|
+
/** Choosing a new password: for a reset, or to finish an account started by email. */
|
|
126
|
+
export type LoginNewPasswordState = {
|
|
127
|
+
kind: 'new-password';
|
|
128
|
+
passwordPolicy: PassflowPasswordPolicySettings | null;
|
|
129
|
+
/** Default `New password`. */
|
|
130
|
+
label?: string;
|
|
131
|
+
/** Default `Enter your new password below.` */
|
|
132
|
+
hint?: string;
|
|
133
|
+
error?: string | null;
|
|
134
|
+
/** The password is being saved: the field and the button are locked. */
|
|
135
|
+
busy?: boolean;
|
|
136
|
+
/** Default `Save new password`. */
|
|
137
|
+
submitLabel?: string;
|
|
138
|
+
testId?: string;
|
|
139
|
+
onSubmit: (password: string) => void;
|
|
140
|
+
};
|
|
83
141
|
export type LoginPasskeyProgressState = {
|
|
84
142
|
kind: 'passkey-progress';
|
|
85
143
|
working: boolean;
|
|
@@ -172,7 +230,8 @@ export type LoginConsentState = {
|
|
|
172
230
|
};
|
|
173
231
|
export type LoginStatusState = {
|
|
174
232
|
kind: 'status';
|
|
175
|
-
|
|
233
|
+
/** `info` is a neutral notice, such as "check your email"; it keeps the normal logo. */
|
|
234
|
+
tone: 'success' | 'error' | 'disabled' | 'info';
|
|
176
235
|
message: string;
|
|
177
236
|
detail?: string;
|
|
178
237
|
recoverable?: boolean;
|
|
@@ -184,7 +243,7 @@ export type LoginStatusState = {
|
|
|
184
243
|
onClick: () => void;
|
|
185
244
|
};
|
|
186
245
|
};
|
|
187
|
-
export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
|
|
246
|
+
export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginEmailCodeState | LoginNewPasswordState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
|
|
188
247
|
export type LoginScreenProps = {
|
|
189
248
|
chrome: LoginScreenChrome;
|
|
190
249
|
state: LoginScreenState;
|
|
@@ -3,7 +3,11 @@ import type { AuthUiError, DefaultMethod } from '../../../types/index.js';
|
|
|
3
3
|
export type LoginScreenChrome = {
|
|
4
4
|
title: string;
|
|
5
5
|
subtitle?: string;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* `sign-in` and `reset-password` keep the wrapper class (`passflow-signin-wrapper`,
|
|
8
|
+
* `passflow-reset-password-wrapper`) that an app's custom CSS may target.
|
|
9
|
+
*/
|
|
10
|
+
variant?: 'sign-in' | 'reset-password';
|
|
7
11
|
customCss?: string;
|
|
8
12
|
customLogo?: string;
|
|
9
13
|
customLogoAlt?: string;
|
|
@@ -80,6 +84,60 @@ export type LoginCodeEntryState = {
|
|
|
80
84
|
testId?: string;
|
|
81
85
|
onSubmit: (code: string) => void;
|
|
82
86
|
};
|
|
87
|
+
/** The resend control of the emailed-code step. Omitted when the code cannot be sent again. */
|
|
88
|
+
export type LoginEmailCodeResend = {
|
|
89
|
+
/** Seconds the control waits before it can be pressed. Default 30; restarts on every press and on `restartKey` change. */
|
|
90
|
+
cooldownSeconds?: number;
|
|
91
|
+
/** Changes when a new code was sent (pass the challenge id): restarts the cooldown and clears the typed code. */
|
|
92
|
+
restartKey?: string;
|
|
93
|
+
/** A resend is in flight. */
|
|
94
|
+
busy?: boolean;
|
|
95
|
+
/** Default `Resend code`. */
|
|
96
|
+
label?: string;
|
|
97
|
+
onResend: () => void;
|
|
98
|
+
};
|
|
99
|
+
/** The way back out of the step, such as `Use a different email` or `Back to sign in`. */
|
|
100
|
+
export type LoginScreenAction = {
|
|
101
|
+
label: string;
|
|
102
|
+
onClick: () => void;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* The emailed verification code step: the server's prompt, a row of code boxes,
|
|
106
|
+
* Verify, Resend and a way back.
|
|
107
|
+
*/
|
|
108
|
+
export type LoginEmailCodeState = {
|
|
109
|
+
kind: 'email-code';
|
|
110
|
+
/** The server's prompt, such as "We sent a code to a***@example.com."; it also names the code field. */
|
|
111
|
+
message: string;
|
|
112
|
+
/** Digits in the code. Default 6. */
|
|
113
|
+
length?: number;
|
|
114
|
+
/** The server's answer to a failed verify or resend; clears the typed code. */
|
|
115
|
+
error?: string | null;
|
|
116
|
+
/** A verify is in flight: the code, Resend and the way back are locked. */
|
|
117
|
+
busy?: boolean;
|
|
118
|
+
/** Default `Verify`. */
|
|
119
|
+
submitLabel?: string;
|
|
120
|
+
resend?: LoginEmailCodeResend;
|
|
121
|
+
secondaryAction?: LoginScreenAction;
|
|
122
|
+
testId?: string;
|
|
123
|
+
onSubmit: (code: string) => void;
|
|
124
|
+
};
|
|
125
|
+
/** Choosing a new password: for a reset, or to finish an account started by email. */
|
|
126
|
+
export type LoginNewPasswordState = {
|
|
127
|
+
kind: 'new-password';
|
|
128
|
+
passwordPolicy: PassflowPasswordPolicySettings | null;
|
|
129
|
+
/** Default `New password`. */
|
|
130
|
+
label?: string;
|
|
131
|
+
/** Default `Enter your new password below.` */
|
|
132
|
+
hint?: string;
|
|
133
|
+
error?: string | null;
|
|
134
|
+
/** The password is being saved: the field and the button are locked. */
|
|
135
|
+
busy?: boolean;
|
|
136
|
+
/** Default `Save new password`. */
|
|
137
|
+
submitLabel?: string;
|
|
138
|
+
testId?: string;
|
|
139
|
+
onSubmit: (password: string) => void;
|
|
140
|
+
};
|
|
83
141
|
export type LoginPasskeyProgressState = {
|
|
84
142
|
kind: 'passkey-progress';
|
|
85
143
|
working: boolean;
|
|
@@ -172,7 +230,8 @@ export type LoginConsentState = {
|
|
|
172
230
|
};
|
|
173
231
|
export type LoginStatusState = {
|
|
174
232
|
kind: 'status';
|
|
175
|
-
|
|
233
|
+
/** `info` is a neutral notice, such as "check your email"; it keeps the normal logo. */
|
|
234
|
+
tone: 'success' | 'error' | 'disabled' | 'info';
|
|
176
235
|
message: string;
|
|
177
236
|
detail?: string;
|
|
178
237
|
recoverable?: boolean;
|
|
@@ -184,7 +243,7 @@ export type LoginStatusState = {
|
|
|
184
243
|
onClick: () => void;
|
|
185
244
|
};
|
|
186
245
|
};
|
|
187
|
-
export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
|
|
246
|
+
export type LoginScreenState = LoginCredentialsState | LoginCodeEntryState | LoginEmailCodeState | LoginNewPasswordState | LoginPasskeyProgressState | LoginDeviceApprovalState | LoginSecondFactorState | LoginInvitationState | LoginGeneralErrorState | LoginConsentState | LoginStatusState;
|
|
188
247
|
export type LoginScreenProps = {
|
|
189
248
|
chrome: LoginScreenChrome;
|
|
190
249
|
state: LoginScreenState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/login-screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,E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@passflow/core';
|
|
1
|
+
import { type ParsedTokens, type SessionExpiredReason, type Tokens } from '@passflow/core';
|
|
2
2
|
import { type FC, type PropsWithChildren } from 'react';
|
|
3
|
-
export type SessionExpiredHandler = (reason:
|
|
3
|
+
export type SessionExpiredHandler = (reason: SessionExpiredReason) => void;
|
|
4
4
|
export type AuthContextValue = {
|
|
5
5
|
isAuthenticated: () => boolean;
|
|
6
6
|
logout: () => void;
|
|
@@ -14,8 +14,9 @@ export type AuthContextValue = {
|
|
|
14
14
|
export declare const AuthContext: import("react").Context<AuthContextValue | undefined>;
|
|
15
15
|
export type AuthProviderProps = PropsWithChildren<{
|
|
16
16
|
/**
|
|
17
|
-
* Called when the session
|
|
18
|
-
*
|
|
17
|
+
* Called when the session has really ended: last auth strike, no successor token pair
|
|
18
|
+
* in time, or another user's tokens in storage. A transient refresh failure keeps the
|
|
19
|
+
* session and does not call this. Use this to redirect to your login page.
|
|
19
20
|
*/
|
|
20
21
|
onSessionExpired?: SessionExpiredHandler;
|
|
21
22
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ParsedTokens, type Tokens } from '@passflow/core';
|
|
1
|
+
import { type ParsedTokens, type SessionExpiredReason, type Tokens } from '@passflow/core';
|
|
2
2
|
import { type FC, type PropsWithChildren } from 'react';
|
|
3
|
-
export type SessionExpiredHandler = (reason:
|
|
3
|
+
export type SessionExpiredHandler = (reason: SessionExpiredReason) => void;
|
|
4
4
|
export type AuthContextValue = {
|
|
5
5
|
isAuthenticated: () => boolean;
|
|
6
6
|
logout: () => void;
|
|
@@ -14,8 +14,9 @@ export type AuthContextValue = {
|
|
|
14
14
|
export declare const AuthContext: import("react").Context<AuthContextValue | undefined>;
|
|
15
15
|
export type AuthProviderProps = PropsWithChildren<{
|
|
16
16
|
/**
|
|
17
|
-
* Called when the session
|
|
18
|
-
*
|
|
17
|
+
* Called when the session has really ended: last auth strike, no successor token pair
|
|
18
|
+
* in time, or another user's tokens in storage. A transient refresh failure keeps the
|
|
19
|
+
* session and does not call this. Use this to redirect to your login page.
|
|
19
20
|
*/
|
|
20
21
|
onSessionExpired?: SessionExpiredHandler;
|
|
21
22
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-context.d.ts","sourceRoot":"","sources":["../../../src/context/auth-context.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"auth-context.d.ts","sourceRoot":"","sources":["../../../src/context/auth-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAiB,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAoC,MAAM,OAAO,CAAC;AAGzG,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,YAAY,EAAE,YAAY,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;CACpH,CAAC;AAEF,eAAO,MAAM,WAAW,uDAAyD,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;IAChD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;CAC1C,CAAC,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAkE9C,CAAC"}
|
|
@@ -3,6 +3,7 @@ export { useAuth } from './use-auth.cjs';
|
|
|
3
3
|
export { useAuthCloudRedirect } from './use-auth-cloud-redirect.cjs';
|
|
4
4
|
export { type ConsentError, type ConsentInfo, type ConsentScopeMetadata, type ConsentStatus, type UseConsentProps, useConsent, } from './use-consent.cjs';
|
|
5
5
|
export { type DeviceUIMode, type DeviceVerifyInfo, type DeviceVerifyStatus, type UseDeviceVerifyProps, useDeviceVerify, } from './use-device-verify.cjs';
|
|
6
|
+
export { type UseEmailCodeStep, type UseEmailCodeStepOptions, useEmailCodeStep, } from './use-email-code-step.cjs';
|
|
6
7
|
export { type UseForgotPasswordProps, useForgotPassword } from './use-forgot-password.cjs';
|
|
7
8
|
export { useJoinInvite } from './use-join-invite.cjs';
|
|
8
9
|
export { type UseLogoutProps, useLogout } from './use-logout.cjs';
|
|
@@ -11,8 +12,9 @@ export { useOutsideClick } from './use-outsideclick.cjs';
|
|
|
11
12
|
export { usePassflow } from './use-passflow.cjs';
|
|
12
13
|
export { type UsePasswordlessCompleteProps, usePasswordlessComplete } from './use-passwordless-complete.cjs';
|
|
13
14
|
export { type UseProviderProps, useProvider } from './use-provider.cjs';
|
|
15
|
+
export { type UseRefreshStatusResult, useRefreshStatus } from './use-refresh-status.cjs';
|
|
14
16
|
export { type UseResetPasswordProps, useResetPassword } from './use-reset-password.cjs';
|
|
15
|
-
export { type
|
|
17
|
+
export { type UseSessionExpiredOptions, type UseSessionExpiredResult, useSessionExpired, } from './use-session-expired.cjs';
|
|
16
18
|
export { type UseSignInProps, useSignIn } from './use-signin.cjs';
|
|
17
19
|
export { type UseSignUpProps, useSignUp } from './use-signup.cjs';
|
|
18
20
|
export { type UseTrustedDevicesProps, useTrustedDevices } from './use-trusted-devices.cjs';
|
|
@@ -3,6 +3,7 @@ export { useAuth } from './use-auth.js';
|
|
|
3
3
|
export { useAuthCloudRedirect } from './use-auth-cloud-redirect.js';
|
|
4
4
|
export { type ConsentError, type ConsentInfo, type ConsentScopeMetadata, type ConsentStatus, type UseConsentProps, useConsent, } from './use-consent.js';
|
|
5
5
|
export { type DeviceUIMode, type DeviceVerifyInfo, type DeviceVerifyStatus, type UseDeviceVerifyProps, useDeviceVerify, } from './use-device-verify.js';
|
|
6
|
+
export { type UseEmailCodeStep, type UseEmailCodeStepOptions, useEmailCodeStep, } from './use-email-code-step.js';
|
|
6
7
|
export { type UseForgotPasswordProps, useForgotPassword } from './use-forgot-password.js';
|
|
7
8
|
export { useJoinInvite } from './use-join-invite.js';
|
|
8
9
|
export { type UseLogoutProps, useLogout } from './use-logout.js';
|
|
@@ -11,8 +12,9 @@ export { useOutsideClick } from './use-outsideclick.js';
|
|
|
11
12
|
export { usePassflow } from './use-passflow.js';
|
|
12
13
|
export { type UsePasswordlessCompleteProps, usePasswordlessComplete } from './use-passwordless-complete.js';
|
|
13
14
|
export { type UseProviderProps, useProvider } from './use-provider.js';
|
|
15
|
+
export { type UseRefreshStatusResult, useRefreshStatus } from './use-refresh-status.js';
|
|
14
16
|
export { type UseResetPasswordProps, useResetPassword } from './use-reset-password.js';
|
|
15
|
-
export { type
|
|
17
|
+
export { type UseSessionExpiredOptions, type UseSessionExpiredResult, useSessionExpired, } from './use-session-expired.js';
|
|
16
18
|
export { type UseSignInProps, useSignIn } from './use-signin.js';
|
|
17
19
|
export { type UseSignUpProps, useSignUp } from './use-signup.js';
|
|
18
20
|
export { type UseTrustedDevicesProps, useTrustedDevices } from './use-trusted-devices.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB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