@passflow/react 0.18.0 → 0.20.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.es.js +136 -136
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/src/components/flow/passflow/index.d.cts +7 -1
  7. package/dist/src/components/flow/passflow/index.d.ts +7 -1
  8. package/dist/src/components/flow/passflow/index.d.ts.map +1 -1
  9. package/dist/src/components/flow/two-factor-setup-magic-link/index.d.ts.map +1 -1
  10. package/dist/src/components/flow/two-factor-verify/index.d.cts +0 -2
  11. package/dist/src/components/flow/two-factor-verify/index.d.ts +0 -2
  12. package/dist/src/components/flow/two-factor-verify/index.d.ts.map +1 -1
  13. package/dist/src/components/flow/two-factor-verify/screen.d.cts +5 -0
  14. package/dist/src/components/flow/two-factor-verify/screen.d.ts +5 -0
  15. package/dist/src/components/flow/two-factor-verify/screen.d.ts.map +1 -0
  16. package/dist/src/components/form/reset-password/index.d.ts.map +1 -1
  17. package/dist/src/components/form/signin/index.d.cts +2 -1
  18. package/dist/src/components/form/signin/index.d.ts +2 -1
  19. package/dist/src/components/form/signin/index.d.ts.map +1 -1
  20. package/dist/src/components/form/signup/index.d.cts +2 -1
  21. package/dist/src/components/form/signup/index.d.ts +2 -1
  22. package/dist/src/components/form/signup/index.d.ts.map +1 -1
  23. package/dist/src/components/form/two-factor-challenge/index.d.ts.map +1 -1
  24. package/dist/src/components/form/two-factor-setup/setup-screen.d.cts +29 -0
  25. package/dist/src/components/form/two-factor-setup/setup-screen.d.ts +29 -0
  26. package/dist/src/components/form/two-factor-setup/setup-screen.d.ts.map +1 -0
  27. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.cts +3 -0
  28. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts +3 -0
  29. package/dist/src/components/form/two-factor-setup/two-factor-setup-form.d.ts.map +1 -1
  30. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.cts +5 -2
  31. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts +5 -2
  32. package/dist/src/components/form/two-factor-verify/two-factor-recovery-form.d.ts.map +1 -1
  33. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.cts +5 -3
  34. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts +5 -3
  35. package/dist/src/components/form/two-factor-verify/two-factor-verify-form.d.ts.map +1 -1
  36. package/dist/src/components/form/verify-challenge/verify-challenge-approval.d.cts +13 -0
  37. package/dist/src/components/form/verify-challenge/verify-challenge-approval.d.ts +13 -0
  38. package/dist/src/components/form/verify-challenge/verify-challenge-approval.d.ts.map +1 -0
  39. package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.cts +6 -1
  40. package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.ts +6 -1
  41. package/dist/src/components/form/verify-challenge/verify-challenge-magic-link.d.ts.map +1 -1
  42. package/dist/src/components/form/verify-challenge/verify-challenge-otp-manual.d.ts.map +1 -1
  43. package/dist/src/components/form/verify-challenge/verify-challenge-otp-redirect.d.ts.map +1 -1
  44. package/dist/src/components/form/verify-challenge/verify-challenge-otp.d.ts.map +1 -1
  45. package/dist/src/components/provider/passflow-provider.d.cts +4 -14
  46. package/dist/src/components/provider/passflow-provider.d.ts +4 -14
  47. package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
  48. package/dist/src/components/ui/login-screen/credentials.d.ts.map +1 -1
  49. package/dist/src/components/ui/login-screen/email-code.d.cts +16 -1
  50. package/dist/src/components/ui/login-screen/email-code.d.ts +16 -1
  51. package/dist/src/components/ui/login-screen/email-code.d.ts.map +1 -1
  52. package/dist/src/components/ui/login-screen/index.d.cts +1 -1
  53. package/dist/src/components/ui/login-screen/index.d.ts +1 -1
  54. package/dist/src/components/ui/login-screen/index.d.ts.map +1 -1
  55. package/dist/src/components/ui/login-screen/login-screen.d.ts.map +1 -1
  56. package/dist/src/components/ui/login-screen/passwordless-approval.d.cts +4 -0
  57. package/dist/src/components/ui/login-screen/passwordless-approval.d.ts +4 -0
  58. package/dist/src/components/ui/login-screen/passwordless-approval.d.ts.map +1 -0
  59. package/dist/src/components/ui/login-screen/passwordless-waiting.d.cts +4 -0
  60. package/dist/src/components/ui/login-screen/passwordless-waiting.d.ts +4 -0
  61. package/dist/src/components/ui/login-screen/passwordless-waiting.d.ts.map +1 -0
  62. package/dist/src/components/ui/login-screen/shared.d.cts +4 -0
  63. package/dist/src/components/ui/login-screen/shared.d.ts +4 -0
  64. package/dist/src/components/ui/login-screen/shared.d.ts.map +1 -1
  65. package/dist/src/components/ui/login-screen/status.d.ts.map +1 -1
  66. package/dist/src/components/ui/login-screen/two-factor-code.d.cts +8 -0
  67. package/dist/src/components/ui/login-screen/two-factor-code.d.ts +8 -0
  68. package/dist/src/components/ui/login-screen/two-factor-code.d.ts.map +1 -0
  69. package/dist/src/components/ui/login-screen/two-factor-recovery-codes.d.cts +5 -0
  70. package/dist/src/components/ui/login-screen/two-factor-recovery-codes.d.ts +5 -0
  71. package/dist/src/components/ui/login-screen/two-factor-recovery-codes.d.ts.map +1 -0
  72. package/dist/src/components/ui/login-screen/two-factor-setup.d.cts +4 -0
  73. package/dist/src/components/ui/login-screen/two-factor-setup.d.ts +4 -0
  74. package/dist/src/components/ui/login-screen/two-factor-setup.d.ts.map +1 -0
  75. package/dist/src/components/ui/login-screen/types.d.cts +160 -6
  76. package/dist/src/components/ui/login-screen/types.d.ts +160 -6
  77. package/dist/src/components/ui/login-screen/types.d.ts.map +1 -1
  78. package/dist/src/context/navigation-context.d.cts +3 -0
  79. package/dist/src/context/navigation-context.d.ts +3 -0
  80. package/dist/src/context/navigation-context.d.ts.map +1 -1
  81. package/dist/src/hooks/use-provider.d.cts +2 -1
  82. package/dist/src/hooks/use-provider.d.ts +2 -1
  83. package/dist/src/hooks/use-provider.d.ts.map +1 -1
  84. package/dist/src/hooks/use-two-factor-enrollment.d.cts +58 -0
  85. package/dist/src/hooks/use-two-factor-enrollment.d.ts +58 -0
  86. package/dist/src/hooks/use-two-factor-enrollment.d.ts.map +1 -0
  87. package/dist/src/hooks/use-two-factor-setup-magic-link.d.cts +5 -15
  88. package/dist/src/hooks/use-two-factor-setup-magic-link.d.ts +5 -15
  89. package/dist/src/hooks/use-two-factor-setup-magic-link.d.ts.map +1 -1
  90. package/dist/src/hooks/use-two-factor-setup.d.ts.map +1 -1
  91. package/dist/src/hooks/use-two-factor-verify.d.ts.map +1 -1
  92. package/dist/src/types/auth-errors.d.cts +2 -0
  93. package/dist/src/types/auth-errors.d.ts +2 -0
  94. package/dist/src/types/auth-errors.d.ts.map +1 -1
  95. package/dist/src/types/index.d.cts +1 -0
  96. package/dist/src/types/index.d.ts +1 -0
  97. package/dist/src/types/index.d.ts.map +1 -1
  98. package/dist/src/types/two-factor-errors.d.cts +1 -2
  99. package/dist/src/types/two-factor-errors.d.ts +1 -2
  100. package/dist/src/types/two-factor-errors.d.ts.map +1 -1
  101. package/dist/src/utils/auth-error.d.cts +55 -1
  102. package/dist/src/utils/auth-error.d.ts +55 -1
  103. package/dist/src/utils/auth-error.d.ts.map +1 -1
  104. package/dist/src/utils/classify-two-factor-error.d.cts +5 -6
  105. package/dist/src/utils/classify-two-factor-error.d.ts +5 -6
  106. package/dist/src/utils/classify-two-factor-error.d.ts.map +1 -1
  107. package/dist/src/utils/index.d.cts +4 -4
  108. package/dist/src/utils/index.d.ts +4 -4
  109. package/dist/src/utils/index.d.ts.map +1 -1
  110. package/dist/src/utils/second-factor.d.cts +7 -1
  111. package/dist/src/utils/second-factor.d.ts +7 -1
  112. package/dist/src/utils/second-factor.d.ts.map +1 -1
  113. package/dist/src/utils/url-params.d.cts +17 -0
  114. package/dist/src/utils/url-params.d.ts +17 -0
  115. package/dist/src/utils/url-params.d.ts.map +1 -1
  116. package/dist/style.css +1 -1
  117. package/package.json +6 -3
@@ -1,5 +1,6 @@
1
1
  import type { Providers } from '@passflow/core';
2
- export type UseProviderProps = (redirectUrl?: string, createTenant?: boolean) => {
2
+ import type { FederatedLanding } from '../types/index.cjs';
3
+ export type UseProviderProps = (redirectUrl?: string, createTenant?: boolean, federatedLanding?: FederatedLanding) => {
3
4
  federatedWithPopup: (provider: Providers, inviteToken?: string) => void;
4
5
  federatedWithRedirect: (provider: Providers, inviteToken?: string) => void;
5
6
  };
@@ -1,5 +1,6 @@
1
1
  import type { Providers } from '@passflow/core';
2
- export type UseProviderProps = (redirectUrl?: string, createTenant?: boolean) => {
2
+ import type { FederatedLanding } from '../types/index.js';
3
+ export type UseProviderProps = (redirectUrl?: string, createTenant?: boolean, federatedLanding?: FederatedLanding) => {
3
4
  federatedWithPopup: (provider: Providers, inviteToken?: string) => void;
4
5
  federatedWithRedirect: (provider: Providers, inviteToken?: string) => void;
5
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-provider.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAa9E,MAAM,MAAM,gBAAgB,GAAG,CAC7B,WAAW,CAAC,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,OAAO,KACnB;IACH,kBAAkB,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,qBAAqB,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5E,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,gBAmBzB,CAAC"}
1
+ {"version":3,"file":"use-provider.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsBhD,MAAM,MAAM,gBAAgB,GAAG,CAC7B,WAAW,CAAC,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,OAAO,EACtB,gBAAgB,CAAC,EAAE,gBAAgB,KAChC;IACH,kBAAkB,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,qBAAqB,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5E,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,gBAsBzB,CAAC"}
@@ -0,0 +1,58 @@
1
+ import type { TwoFactorSetupResponse } from '@passflow/core';
2
+ /** Send taps on the email link screen: send, begin and challenge share 3 requests per 5 minutes on the server. */
3
+ export declare const TWO_FACTOR_LINK_MAX_SENDS = 3;
4
+ export type TwoFactorEnrollmentScreen = {
5
+ kind: 'loading';
6
+ } | {
7
+ kind: 'verify';
8
+ notice?: string;
9
+ digits?: number;
10
+ } | {
11
+ kind: 'email_link';
12
+ sent: boolean;
13
+ sends: number;
14
+ busy: boolean;
15
+ error?: string;
16
+ } | {
17
+ kind: 'direct';
18
+ step: 'start' | 'code' | 'codes';
19
+ data: TwoFactorSetupResponse | null;
20
+ codes: string[];
21
+ busy: boolean;
22
+ error?: string;
23
+ /** Shown on the code step until the next confirm. */
24
+ notice?: string;
25
+ } | {
26
+ kind: 'unavailable';
27
+ } | {
28
+ kind: 'ended';
29
+ message: string;
30
+ } | {
31
+ kind: 'read_failed';
32
+ } | {
33
+ kind: 'finished';
34
+ };
35
+ export type UseTwoFactorEnrollmentProps = {
36
+ /** The sign-in is finished, by the enrolment's verify or by `complete`. */
37
+ onFinished?: () => void;
38
+ };
39
+ export type UseTwoFactorEnrollmentReturn = {
40
+ screen: TwoFactorEnrollmentScreen;
41
+ /** Reads the state. It has no guard, so Try again and the `not_allowed` re-read work. */
42
+ read: () => Promise<void>;
43
+ sendLink: () => Promise<void>;
44
+ begin: () => Promise<void>;
45
+ confirm: (code: string) => Promise<void>;
46
+ /** "I've saved these codes": finishes the sign-in with the code that confirmed. */
47
+ finish: () => Promise<void>;
48
+ /** The verify or recovery form ended the sign-in. */
49
+ end: (type: 'expired' | 'rate_limited') => void;
50
+ /** The verify or recovery form finished the sign-in. */
51
+ complete: () => void;
52
+ };
53
+ /**
54
+ * What the verify screen shows for a pending sign-in, as the server decides it. Nothing that spends budget runs on
55
+ * mount: only the state is read, once, and the link send and begin wait for a tap.
56
+ */
57
+ export declare const useTwoFactorEnrollment: ({ onFinished }?: UseTwoFactorEnrollmentProps) => UseTwoFactorEnrollmentReturn;
58
+ //# sourceMappingURL=use-two-factor-enrollment.d.ts.map
@@ -0,0 +1,58 @@
1
+ import type { TwoFactorSetupResponse } from '@passflow/core';
2
+ /** Send taps on the email link screen: send, begin and challenge share 3 requests per 5 minutes on the server. */
3
+ export declare const TWO_FACTOR_LINK_MAX_SENDS = 3;
4
+ export type TwoFactorEnrollmentScreen = {
5
+ kind: 'loading';
6
+ } | {
7
+ kind: 'verify';
8
+ notice?: string;
9
+ digits?: number;
10
+ } | {
11
+ kind: 'email_link';
12
+ sent: boolean;
13
+ sends: number;
14
+ busy: boolean;
15
+ error?: string;
16
+ } | {
17
+ kind: 'direct';
18
+ step: 'start' | 'code' | 'codes';
19
+ data: TwoFactorSetupResponse | null;
20
+ codes: string[];
21
+ busy: boolean;
22
+ error?: string;
23
+ /** Shown on the code step until the next confirm. */
24
+ notice?: string;
25
+ } | {
26
+ kind: 'unavailable';
27
+ } | {
28
+ kind: 'ended';
29
+ message: string;
30
+ } | {
31
+ kind: 'read_failed';
32
+ } | {
33
+ kind: 'finished';
34
+ };
35
+ export type UseTwoFactorEnrollmentProps = {
36
+ /** The sign-in is finished, by the enrolment's verify or by `complete`. */
37
+ onFinished?: () => void;
38
+ };
39
+ export type UseTwoFactorEnrollmentReturn = {
40
+ screen: TwoFactorEnrollmentScreen;
41
+ /** Reads the state. It has no guard, so Try again and the `not_allowed` re-read work. */
42
+ read: () => Promise<void>;
43
+ sendLink: () => Promise<void>;
44
+ begin: () => Promise<void>;
45
+ confirm: (code: string) => Promise<void>;
46
+ /** "I've saved these codes": finishes the sign-in with the code that confirmed. */
47
+ finish: () => Promise<void>;
48
+ /** The verify or recovery form ended the sign-in. */
49
+ end: (type: 'expired' | 'rate_limited') => void;
50
+ /** The verify or recovery form finished the sign-in. */
51
+ complete: () => void;
52
+ };
53
+ /**
54
+ * What the verify screen shows for a pending sign-in, as the server decides it. Nothing that spends budget runs on
55
+ * mount: only the state is read, once, and the link send and begin wait for a tap.
56
+ */
57
+ export declare const useTwoFactorEnrollment: ({ onFinished }?: UseTwoFactorEnrollmentProps) => UseTwoFactorEnrollmentReturn;
58
+ //# sourceMappingURL=use-two-factor-enrollment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-two-factor-enrollment.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-two-factor-enrollment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAiBlF,kHAAkH;AAClH,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,MAAM,MAAM,yBAAyB,GACjC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACnF;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,sBAAsB,GAAG,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TOKEN' | 'RATE_LIMITED' | 'SERVER_ERROR';
6
- message: string;
7
- retryAfter?: number;
8
- };
1
+ import type { TwoFactorSetupMagicLinkError } from '@passflow/core';
9
2
  /**
10
3
  * Return type for useTwoFactorSetupMagicLink hook
11
4
  */
@@ -26,8 +19,6 @@ export type UseTwoFactorSetupMagicLinkReturn = {
26
19
  appId: string | null;
27
20
  /** Session expiration in seconds */
28
21
  expiresIn: number | null;
29
- /** Retry countdown for rate-limited errors (null if not rate limited) */
30
- retryCountdown: number | null;
31
22
  /** Manual retry function for transient errors */
32
23
  retry: () => Promise<void>;
33
24
  };
@@ -35,19 +26,18 @@ export type UseTwoFactorSetupMagicLinkReturn = {
35
26
  * Hook to validate magic link token for 2FA setup
36
27
  *
37
28
  * This hook:
38
- * - Validates token on mount (automatic)
39
- * - Caches validation result per token (prevents duplicate calls)
29
+ * - Validates once per token on mount (StrictMode included), after app id discovery ends: the session lives in memory
30
+ * on the Passflow instance, and discovery replaces the instance
40
31
  * - Provides loading, error, and success states
41
32
  * - Allows manual retry for transient failures
42
- * - Handles rate limit countdown
43
33
  * - Cleans up conditionally on unmount (only if validation failed or not validated)
44
34
  *
45
35
  * Usage:
46
36
  * ```tsx
47
- * const { isLoading, isValidated, error, retry, retryCountdown } = useTwoFactorSetupMagicLink(token);
37
+ * const { isLoading, isValidated, error, retry } = useTwoFactorSetupMagicLink(token);
48
38
  *
49
39
  * if (isLoading) return <Loading />;
50
- * if (error) return <ErrorUI error={error} onRetry={retry} countdown={retryCountdown} />;
40
+ * if (error) return <ErrorUI error={error} onRetry={retry} />;
51
41
  * if (isValidated) return <TwoFactorSetupForm />;
52
42
  * ```
53
43
  */
@@ -1,11 +1,4 @@
1
- /**
2
- * Magic link validation error type
3
- */
4
- export type TwoFactorSetupMagicLinkError = {
5
- code: 'INVALID_TOKEN' | 'EXPIRED_TOKEN' | 'REVOKED_TOKEN' | 'RATE_LIMITED' | 'SERVER_ERROR';
6
- message: string;
7
- retryAfter?: number;
8
- };
1
+ import type { TwoFactorSetupMagicLinkError } from '@passflow/core';
9
2
  /**
10
3
  * Return type for useTwoFactorSetupMagicLink hook
11
4
  */
@@ -26,8 +19,6 @@ export type UseTwoFactorSetupMagicLinkReturn = {
26
19
  appId: string | null;
27
20
  /** Session expiration in seconds */
28
21
  expiresIn: number | null;
29
- /** Retry countdown for rate-limited errors (null if not rate limited) */
30
- retryCountdown: number | null;
31
22
  /** Manual retry function for transient errors */
32
23
  retry: () => Promise<void>;
33
24
  };
@@ -35,19 +26,18 @@ export type UseTwoFactorSetupMagicLinkReturn = {
35
26
  * Hook to validate magic link token for 2FA setup
36
27
  *
37
28
  * This hook:
38
- * - Validates token on mount (automatic)
39
- * - Caches validation result per token (prevents duplicate calls)
29
+ * - Validates once per token on mount (StrictMode included), after app id discovery ends: the session lives in memory
30
+ * on the Passflow instance, and discovery replaces the instance
40
31
  * - Provides loading, error, and success states
41
32
  * - Allows manual retry for transient failures
42
- * - Handles rate limit countdown
43
33
  * - Cleans up conditionally on unmount (only if validation failed or not validated)
44
34
  *
45
35
  * Usage:
46
36
  * ```tsx
47
- * const { isLoading, isValidated, error, retry, retryCountdown } = useTwoFactorSetupMagicLink(token);
37
+ * const { isLoading, isValidated, error, retry } = useTwoFactorSetupMagicLink(token);
48
38
  *
49
39
  * if (isLoading) return <Loading />;
50
- * if (error) return <ErrorUI error={error} onRetry={retry} countdown={retryCountdown} />;
40
+ * if (error) return <ErrorUI error={error} onRetry={retry} />;
51
41
  * if (isValidated) return <TwoFactorSetupForm />;
52
42
  * ```
53
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"use-two-factor-setup-magic-link.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-two-factor-setup-magic-link.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,eAAe,GAAG,eAAe,GAAG,eAAe,GAAG,cAAc,GAAG,cAAc,CAAC;IAC5F,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAcF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,6BAA6B;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,KAAK,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAC3C,iCAAiC;IACjC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wCAAwC;IACxC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yEAAyE;IACzE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iDAAiD;IACjD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,0BAA0B,UAAW,MAAM,KAAG,gCAiL1D,CAAC"}
1
+ {"version":3,"file":"use-two-factor-setup-magic-link.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-two-factor-setup-magic-link.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAoC,MAAM,gBAAgB,CAAC;AAcrG;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,6BAA6B;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,UAAU,EAAE,OAAO,CAAC;IACpB,2CAA2C;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,KAAK,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAC3C,iCAAiC;IACjC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,wCAAwC;IACxC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iDAAiD;IACjD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B,UAAW,MAAM,KAAG,gCAyG1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-two-factor-setup.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-two-factor-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAIvF,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/D,MAAM,MAAM,sBAAsB,GAAG,MAAM;IACzC,SAAS,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACzC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,kBAAkB,CAAC;IACzB,UAAU,EAAE,MAAM,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAAC;IACzD,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC;IACzE,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,sBAqE/B,CAAC"}
1
+ {"version":3,"file":"use-two-factor-setup.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-two-factor-setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,s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,CAAC;IACnH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,uBAkFhC,CAAC"}
1
+ {"version":3,"file":"use-two-factor-verify.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-two-factor-verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAErH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpF,MAAM,MAAM,uBAAuB,GAAG,MAAM;IAC1C,sBAAsB,EAAE,MAAM,OAAO,CAAC;IACtC,qFAAqF;IACrF,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;IACxG,qFAAqF;IACrF,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAC;IACnH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACrC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,uBAiFhC,CAAC"}
@@ -2,6 +2,8 @@ export type AuthErrorScope = 'form' | 'identity' | 'password' | 'credentials';
2
2
  export type AuthUiError = {
3
3
  message: string;
4
4
  scope: AuthErrorScope;
5
+ /** The request behind this form is gone, so the screen offers a full reload without its parent challenge. */
6
+ startAgain?: boolean;
5
7
  };
6
8
  export type AuthOperation = 'password' | 'passwordless' | 'passkey';
7
9
  export type AuthFlow = 'sign-in' | 'sign-up';
@@ -2,6 +2,8 @@ export type AuthErrorScope = 'form' | 'identity' | 'password' | 'credentials';
2
2
  export type AuthUiError = {
3
3
  message: string;
4
4
  scope: AuthErrorScope;
5
+ /** The request behind this form is gone, so the screen offers a full reload without its parent challenge. */
6
+ startAgain?: boolean;
5
7
  };
6
8
  export type AuthOperation = 'password' | 'passwordless' | 'passkey';
7
9
  export type AuthFlow = 'sign-in' | 'sign-up';
@@ -1 +1 @@
1
- {"version":3,"file":"auth-errors.d.ts","sourceRoot":"","sources":["../../../src/types/auth-errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;AACpE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"auth-errors.d.ts","sourceRoot":"","sources":["../../../src/types/auth-errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,CAAC;IACtB,6GAA6G;IAC7G,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;AACpE,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC"}
@@ -2,6 +2,7 @@ export type PreferIdentity = 'identity' | 'phone' | 'none';
2
2
  export type DefaultMethod = 'email_or_username' | 'phone';
3
3
  export type PreferChallenge = 'passkey' | 'password' | 'otp' | 'magic_link';
4
4
  export type SuccessAuthRedirect = string;
5
+ export type FederatedLanding = 'app' | 'login-page';
5
6
  export type { RegisteredTwoFactorMethod, TwoFactorChallengeResponse, TwoFactorMethod, TwoFactorVerifyRequestV2, TwoFactorVerifyResponseV2, } from '@passflow/core';
6
7
  export type { AuthErrorScope, AuthFlow, AuthOperation, AuthUiError } from './auth-errors.cjs';
7
8
  export type { DeviceError, DeviceErrorType } from './device-errors.cjs';
@@ -2,6 +2,7 @@ export type PreferIdentity = 'identity' | 'phone' | 'none';
2
2
  export type DefaultMethod = 'email_or_username' | 'phone';
3
3
  export type PreferChallenge = 'passkey' | 'password' | 'otp' | 'magic_link';
4
4
  export type SuccessAuthRedirect = string;
5
+ export type FederatedLanding = 'app' | 'login-page';
5
6
  export type { RegisteredTwoFactorMethod, TwoFactorChallengeResponse, TwoFactorMethod, TwoFactorVerifyRequestV2, TwoFactorVerifyResponseV2, } from '@passflow/core';
6
7
  export type { AuthErrorScope, AuthFlow, AuthOperation, AuthUiError } from './auth-errors.js';
7
8
  export type { DeviceError, DeviceErrorType } from './device-errors.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,CAAC;AAE5E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAGzC,YAAY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AAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,cAAc,EAAE,OAAO,gBAAgB,EAAE,eAAe,GAAG,IAAI,CAAC;CACjE;AAED,MAAM,WAAW,yBAAyB;IACxC,gBAAgB,EAAE,OAAO,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAC7D,iBAAiB,EAAE,OAAO,gBAAgB,EAAE,yBAAyB,EAAE,CAAC;IACxE,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Types of 2FA errors with different handling strategies
3
3
  */
4
- export type TwoFactorErrorType = 'expired' | 'not_enabled' | 'invalid_code' | 'generic';
4
+ export type TwoFactorErrorType = 'expired' | 'rate_limited' | 'not_enabled' | 'invalid_code' | 'generic';
5
5
  /**
6
6
  * Structured error information for 2FA errors
7
7
  */
@@ -9,6 +9,5 @@ export type TwoFactorError = {
9
9
  type: TwoFactorErrorType;
10
10
  message: string;
11
11
  isRecoverable: boolean;
12
- shouldAutoRedirect: boolean;
13
12
  };
14
13
  //# sourceMappingURL=two-factor-errors.d.ts.map
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Types of 2FA errors with different handling strategies
3
3
  */
4
- export type TwoFactorErrorType = 'expired' | 'not_enabled' | 'invalid_code' | 'generic';
4
+ export type TwoFactorErrorType = 'expired' | 'rate_limited' | 'not_enabled' | 'invalid_code' | 'generic';
5
5
  /**
6
6
  * Structured error information for 2FA errors
7
7
  */
@@ -9,6 +9,5 @@ export type TwoFactorError = {
9
9
  type: TwoFactorErrorType;
10
10
  message: string;
11
11
  isRecoverable: boolean;
12
- shouldAutoRedirect: boolean;
13
12
  };
14
13
  //# sourceMappingURL=two-factor-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"two-factor-errors.d.ts","sourceRoot":"","sources":["../../../src/types/two-factor-errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,aAAa,GACb,cAAc,GACd,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"two-factor-errors.d.ts","sourceRoot":"","sources":["../../../src/types/two-factor-errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,cAAc,GACd,aAAa,GACb,cAAc,GACd,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC"}
@@ -16,7 +16,7 @@ export declare const SERVER_MESSAGE_ERROR_IDS: ReadonlySet<string>;
16
16
  * redirect's query.
17
17
  */
18
18
  export declare const serverMessageFor: (error: unknown) => string | null;
19
- /** A hook's display error: the server's message for an allow-listed id, else the fixed copy for the operation. */
19
+ /** A hook's display error: a refused parent's copy, the server's message for an allow-listed id, else the operation's fixed copy. */
20
20
  export declare const authErrorFrom: (error: unknown, flow: AuthFlow, operation: AuthOperation) => AuthUiError;
21
21
  /**
22
22
  * The message for a federated redirect that came back as `?error=<id>&message=<text>`: the server's text when the id
@@ -36,6 +36,37 @@ export declare const emailCodeRestartMessage = "We couldn't verify the code. Go
36
36
  * PKCE verifier, an unlisted 4xx or a 5xx) asks to start again, and the screen keeps its way back to the form.
37
37
  */
38
38
  export declare const emailCodeErrorMessage: (error: unknown) => string;
39
+ export declare const passwordlessWaitDeniedMessage = "This sign-in was denied. Start again.";
40
+ export declare const passwordlessLinkExpiredMessage = "This link expired. Start again.";
41
+ export declare const passwordlessWaitCompletedMessage = "This sign-in was already used. Start again.";
42
+ export declare const passwordlessSignInFailedMessage = "Sign-in failed. Start again.";
43
+ export declare const approvalInvalidMessage = "This link is not valid. Start again from the page where you signed in.";
44
+ export declare const approvalUnavailableMessage = "This sign-in cannot be approved here. Start again.";
45
+ export declare const approvalAlreadyDecidedMessage = "This sign-in was already decided.";
46
+ export declare const approvalAttemptsMessage = "Too many wrong codes. This sign-in was denied. Start again.";
47
+ export declare const approvalConnectionMessage = "Check your connection and try again.";
48
+ export declare const approvalUnknownErrorMessage = "Something went wrong. Try again later.";
49
+ export declare const approvalApprovedMessage = "Approved. Return to the tab that started sign-in. You can close this tab.";
50
+ export declare const approvalDeniedMessage = "Denied. No one was signed in. You can close this tab.";
51
+ export type ApprovalError = {
52
+ message: string;
53
+ /** Nothing more can be done on this screen: the form goes away. */
54
+ terminal: boolean;
55
+ };
56
+ /** A wrong code on the approve screen: the tries left must be read again before showing the message. */
57
+ export declare const isApprovalMatchError: (error: unknown) => boolean;
58
+ /**
59
+ * Error copy for the approve screen. `attemptsLeft` is the count re-read after the rejection. A plain core error with
60
+ * no response body arrives as id `error.passwordless.approval`, status 0: nothing was decided, so the screen stays.
61
+ */
62
+ export declare const approvalErrorFrom: (error: unknown, attemptsLeft?: number) => ApprovalError;
63
+ /**
64
+ * A failed passwordless completion. A row that only another device can approve has its own copy. A failed exchange comes
65
+ * after the row was spent, so retrying cannot work, even with no response (id `error.pkce.exchange`, status 0). Core
66
+ * rejects a network failure or raw 429 on the completion itself as id `error.passwordless.complete`: the code was not
67
+ * refused, so the user can try again.
68
+ */
69
+ export declare const passwordlessCompleteErrorMessage: (error: unknown) => string;
39
70
  export declare const resetLinkInvalidMessage = "This link is invalid or has expired. Request a new one.";
40
71
  export declare const newPasswordUnavailableMessage = "We couldn't save your password. Try again.";
41
72
  export declare const passwordSavedRateLimitedMessage = "Your password was saved, but we cannot send a verification code right now. Wait a few minutes, then sign in with your new password.";
@@ -50,4 +81,27 @@ export declare const isPasswordSavedRateLimit: (error: unknown) => boolean;
50
81
  * failure asks to retry. The raw message of anything else is never shown.
51
82
  */
52
83
  export declare const newPasswordErrorMessage: (error: unknown) => string;
84
+ export declare const twoFactorSignInOverMessage = "Your sign-in has ended. Sign in again.";
85
+ export declare const twoFactorSetupSavedSignInMessage = "Your setup is saved. Sign in again.";
86
+ export declare const twoFactorSetupSavedNewCodeMessage = "Your setup is saved. Enter a new code from your authenticator app to finish signing in.";
87
+ export declare const twoFactorSetupCodeChangedMessage = "Your setup code changed. Scan this new QR code.";
88
+ export declare const twoFactorRateLimitedMessage = "Too many attempts. Sign in again later.";
89
+ export declare const twoFactorWrongCodeMessage = "Invalid code. Please check your authenticator app and try again.";
90
+ export declare const twoFactorWrongRecoveryCodeMessage = "Invalid recovery code.";
91
+ export declare const twoFactorNotEnabledMessage = "Two-factor authentication is not enabled for your account. Please contact your administrator to enable 2FA.";
92
+ export declare const twoFactorSendFailedMessage = "We could not send the setup email. Try again later or contact your administrator.";
93
+ export declare const twoFactorTryAgainMessage = "Something went wrong. Try again.";
94
+ export declare const twoFactorLinkAlreadyUsedMessage = "This link was already used. Sign in.";
95
+ export declare const twoFactorBackToSignInLabel = "Back to sign in";
96
+ export declare const twoFactorSignInLabel = "Sign in";
97
+ export type EnrollmentFailure = 'over' | 'rate_limited' | 'wrong_code' | 'setup_incomplete' | 'not_allowed' | 'send_failed' | 'unavailable' | 'other';
98
+ /** The id of a server error, in a `PassflowError` or a raw axios rejection's object body. */
99
+ export declare const serverErrorIdFrom: (error: unknown) => unknown;
100
+ /** The HTTP status of a server error. `readServerError` skips a raw 429's string body, so its response is read too. */
101
+ export declare const serverErrorStatusFrom: (error: unknown) => unknown;
102
+ /**
103
+ * What a failed confirm, verify, begin or send means for the sign-in. The order matters: several ids answer 401 and do
104
+ * not mean the sign-in ended. Network errors, core's format errors and a `TypeError` from a string body are `other`.
105
+ */
106
+ export declare const enrollmentFailureFrom: (error: unknown) => EnrollmentFailure;
53
107
  //# sourceMappingURL=auth-error.d.ts.map
@@ -16,7 +16,7 @@ export declare const SERVER_MESSAGE_ERROR_IDS: ReadonlySet<string>;
16
16
  * redirect's query.
17
17
  */
18
18
  export declare const serverMessageFor: (error: unknown) => string | null;
19
- /** A hook's display error: the server's message for an allow-listed id, else the fixed copy for the operation. */
19
+ /** A hook's display error: a refused parent's copy, the server's message for an allow-listed id, else the operation's fixed copy. */
20
20
  export declare const authErrorFrom: (error: unknown, flow: AuthFlow, operation: AuthOperation) => AuthUiError;
21
21
  /**
22
22
  * The message for a federated redirect that came back as `?error=<id>&message=<text>`: the server's text when the id
@@ -36,6 +36,37 @@ export declare const emailCodeRestartMessage = "We couldn't verify the code. Go
36
36
  * PKCE verifier, an unlisted 4xx or a 5xx) asks to start again, and the screen keeps its way back to the form.
37
37
  */
38
38
  export declare const emailCodeErrorMessage: (error: unknown) => string;
39
+ export declare const passwordlessWaitDeniedMessage = "This sign-in was denied. Start again.";
40
+ export declare const passwordlessLinkExpiredMessage = "This link expired. Start again.";
41
+ export declare const passwordlessWaitCompletedMessage = "This sign-in was already used. Start again.";
42
+ export declare const passwordlessSignInFailedMessage = "Sign-in failed. Start again.";
43
+ export declare const approvalInvalidMessage = "This link is not valid. Start again from the page where you signed in.";
44
+ export declare const approvalUnavailableMessage = "This sign-in cannot be approved here. Start again.";
45
+ export declare const approvalAlreadyDecidedMessage = "This sign-in was already decided.";
46
+ export declare const approvalAttemptsMessage = "Too many wrong codes. This sign-in was denied. Start again.";
47
+ export declare const approvalConnectionMessage = "Check your connection and try again.";
48
+ export declare const approvalUnknownErrorMessage = "Something went wrong. Try again later.";
49
+ export declare const approvalApprovedMessage = "Approved. Return to the tab that started sign-in. You can close this tab.";
50
+ export declare const approvalDeniedMessage = "Denied. No one was signed in. You can close this tab.";
51
+ export type ApprovalError = {
52
+ message: string;
53
+ /** Nothing more can be done on this screen: the form goes away. */
54
+ terminal: boolean;
55
+ };
56
+ /** A wrong code on the approve screen: the tries left must be read again before showing the message. */
57
+ export declare const isApprovalMatchError: (error: unknown) => boolean;
58
+ /**
59
+ * Error copy for the approve screen. `attemptsLeft` is the count re-read after the rejection. A plain core error with
60
+ * no response body arrives as id `error.passwordless.approval`, status 0: nothing was decided, so the screen stays.
61
+ */
62
+ export declare const approvalErrorFrom: (error: unknown, attemptsLeft?: number) => ApprovalError;
63
+ /**
64
+ * A failed passwordless completion. A row that only another device can approve has its own copy. A failed exchange comes
65
+ * after the row was spent, so retrying cannot work, even with no response (id `error.pkce.exchange`, status 0). Core
66
+ * rejects a network failure or raw 429 on the completion itself as id `error.passwordless.complete`: the code was not
67
+ * refused, so the user can try again.
68
+ */
69
+ export declare const passwordlessCompleteErrorMessage: (error: unknown) => string;
39
70
  export declare const resetLinkInvalidMessage = "This link is invalid or has expired. Request a new one.";
40
71
  export declare const newPasswordUnavailableMessage = "We couldn't save your password. Try again.";
41
72
  export declare const passwordSavedRateLimitedMessage = "Your password was saved, but we cannot send a verification code right now. Wait a few minutes, then sign in with your new password.";
@@ -50,4 +81,27 @@ export declare const isPasswordSavedRateLimit: (error: unknown) => boolean;
50
81
  * failure asks to retry. The raw message of anything else is never shown.
51
82
  */
52
83
  export declare const newPasswordErrorMessage: (error: unknown) => string;
84
+ export declare const twoFactorSignInOverMessage = "Your sign-in has ended. Sign in again.";
85
+ export declare const twoFactorSetupSavedSignInMessage = "Your setup is saved. Sign in again.";
86
+ export declare const twoFactorSetupSavedNewCodeMessage = "Your setup is saved. Enter a new code from your authenticator app to finish signing in.";
87
+ export declare const twoFactorSetupCodeChangedMessage = "Your setup code changed. Scan this new QR code.";
88
+ export declare const twoFactorRateLimitedMessage = "Too many attempts. Sign in again later.";
89
+ export declare const twoFactorWrongCodeMessage = "Invalid code. Please check your authenticator app and try again.";
90
+ export declare const twoFactorWrongRecoveryCodeMessage = "Invalid recovery code.";
91
+ export declare const twoFactorNotEnabledMessage = "Two-factor authentication is not enabled for your account. Please contact your administrator to enable 2FA.";
92
+ export declare const twoFactorSendFailedMessage = "We could not send the setup email. Try again later or contact your administrator.";
93
+ export declare const twoFactorTryAgainMessage = "Something went wrong. Try again.";
94
+ export declare const twoFactorLinkAlreadyUsedMessage = "This link was already used. Sign in.";
95
+ export declare const twoFactorBackToSignInLabel = "Back to sign in";
96
+ export declare const twoFactorSignInLabel = "Sign in";
97
+ export type EnrollmentFailure = 'over' | 'rate_limited' | 'wrong_code' | 'setup_incomplete' | 'not_allowed' | 'send_failed' | 'unavailable' | 'other';
98
+ /** The id of a server error, in a `PassflowError` or a raw axios rejection's object body. */
99
+ export declare const serverErrorIdFrom: (error: unknown) => unknown;
100
+ /** The HTTP status of a server error. `readServerError` skips a raw 429's string body, so its response is read too. */
101
+ export declare const serverErrorStatusFrom: (error: unknown) => unknown;
102
+ /**
103
+ * What a failed confirm, verify, begin or send means for the sign-in. The order matters: several ids answer 401 and do
104
+ * not mean the sign-in ended. Network errors, core's format errors and a `TypeError` from a string body are `other`.
105
+ */
106
+ export declare const enrollmentFailureFrom: (error: unknown) => EnrollmentFailure;
53
107
  //# sourceMappingURL=auth-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-error.d.ts","sourceRoot":"","sources":["../../../src/utils/auth-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAiCpE,eAAO,MAAM,wBAAwB,uFAAuF,CAAC;AAE7H,eAAO,MAAM,4BAA4B,+FACqD,CAAC;AAE/F,eAAO,MAAM,0BAA0B,oDAAoD,CAAC;AAE5F,eAAO,MAAM,+BAA+B,iGACoD,CAAC;AAEjG,eAAO,MAAM,YAAY,SAAU,QAAQ,aAAa,aAAa,KAAG,WAA+C,CAAC;AAExH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,WAAW,CA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ACb,aAAa,GACb,OAAO,CAAC;AAEZ,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,OAAkD,CAAC;AAEtG,uHAAuH;AACvH,eAAO,MAAM,qBAAqB,UAAW,OAAO,KAAG,OAC2C,CAAC;AAiBnG;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAAW,OAAO,KAAG,iBAetD,CAAC"}
@@ -1,11 +1,10 @@
1
- import type { TwoFactorError } from '../types/two-factor-errors.cjs';
1
+ import type { TwoFactorError, TwoFactorErrorType } from '../types/two-factor-errors.cjs';
2
2
  /**
3
- * Classify 2FA error based on error message
4
- *
5
- * @param errorMessage - Error message from SDK
6
- * @returns Classified error with handling strategy
3
+ * Classify a 2FA error from the error itself, not its message: the server localises messages.
7
4
  */
8
- export declare function classifyTwoFactorError(errorMessage: string): TwoFactorError;
5
+ export declare function classifyTwoFactorError(error: unknown): TwoFactorError;
6
+ /** No further code can be taken on the screen: only the way back to sign in is left. */
7
+ export declare const isTerminalTwoFactorError: (type: TwoFactorErrorType | undefined) => boolean;
9
8
  /**
10
9
  * Get user-friendly error message based on error type
11
10
  */
@@ -1,11 +1,10 @@
1
- import type { TwoFactorError } from '../types/two-factor-errors.js';
1
+ import type { TwoFactorError, TwoFactorErrorType } from '../types/two-factor-errors.js';
2
2
  /**
3
- * Classify 2FA error based on error message
4
- *
5
- * @param errorMessage - Error message from SDK
6
- * @returns Classified error with handling strategy
3
+ * Classify a 2FA error from the error itself, not its message: the server localises messages.
7
4
  */
8
- export declare function classifyTwoFactorError(errorMessage: string): TwoFactorError;
5
+ export declare function classifyTwoFactorError(error: unknown): TwoFactorError;
6
+ /** No further code can be taken on the screen: only the way back to sign in is left. */
7
+ export declare const isTerminalTwoFactorError: (type: TwoFactorErrorType | undefined) => boolean;
9
8
  /**
10
9
  * Get user-friendly error message based on error type
11
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"classify-two-factor-error.d.ts","sourceRoot":"","sources":["../../../src/utils/classify-two-factor-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAWhE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,CAwC3E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAWzE"}
1
+ {"version":3,"file":"classify-two-factor-error.d.ts","sourceRoot":"","sources":["../../../src/utils/classify-two-factor-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AA0BpF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAOrE;AAED,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,SAAU,kBAAkB,GAAG,SAAS,KAAG,OACP,CAAC;AAE1E;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAazE"}
@@ -1,6 +1,6 @@
1
- export { authErrorFor, authErrorFrom, authRedirectErrorFrom, authRedirectErrorMessage, emailCodeErrorMessage, invitationJoinErrorFrom, invitationLinkErrorMessage, isPasswordSavedRateLimit, newPasswordErrorMessage, serverMessageFor, verificationLinkErrorMessage, verificationRequestErrorMessage, } from './auth-error.cjs';
1
+ export { type ApprovalError, approvalAlreadyDecidedMessage, approvalApprovedMessage, approvalAttemptsMessage, approvalConnectionMessage, approvalDeniedMessage, approvalErrorFrom, approvalInvalidMessage, approvalUnavailableMessage, approvalUnknownErrorMessage, authErrorFor, authErrorFrom, authRedirectErrorFrom, authRedirectErrorMessage, emailCodeErrorMessage, invitationJoinErrorFrom, invitationLinkErrorMessage, isApprovalMatchError, isPasswordSavedRateLimit, newPasswordErrorMessage, passwordlessCompleteErrorMessage, passwordlessLinkExpiredMessage, passwordlessSignInFailedMessage, passwordlessWaitCompletedMessage, passwordlessWaitDeniedMessage, serverMessageFor, twoFactorBackToSignInLabel, twoFactorLinkAlreadyUsedMessage, twoFactorRateLimitedMessage, twoFactorSignInLabel, twoFactorWrongRecoveryCodeMessage, verificationLinkErrorMessage, verificationRequestErrorMessage, } from './auth-error.cjs';
2
2
  export { classifyDeviceError, DeviceApiError, deviceErrorOfType } from './classify-device-error.cjs';
3
- export { classifyTwoFactorError, getUserFriendlyErrorMessage } from './classify-two-factor-error.cjs';
3
+ export { classifyTwoFactorError, getUserFriendlyErrorMessage, isTerminalTwoFactorError } from './classify-two-factor-error.cjs';
4
4
  export { cn } from './cn.cjs';
5
5
  export * from './dayjs/index.cjs';
6
6
  export { type EmailCodeStepEvent, type EmailCodeStepState, emailCodeStepReducer, initialEmailCodeStepState, readEmailVerificationStep, } from './email-verification.cjs';
@@ -9,11 +9,11 @@ export { getIdentityLabel, getPasswordlessData, getValidationErrorsLabel } from
9
9
  export { getUrlErrors } from './get-url-errors.cjs';
10
10
  export { getUrlWithTokens, type TokenUrlFormat } from './get-url-with-tokens.cjs';
11
11
  export { getInvitationAuthChrome, type InvitationAuthIntent } from './invitation-auth-chrome.cjs';
12
- export { routeToSecondFactor, urlCarriesTwoFactorToken } from './second-factor.cjs';
12
+ export { routeToSecondFactor, signInSearch, urlCarriesTwoFactorToken } from './second-factor.cjs';
13
13
  export { TwoFactorLoopPrevention } from './two-factor-loop-prevention.cjs';
14
14
  export { undefinedOnCatch } from './undefined-on-catch.cjs';
15
15
  export { attachAuth, registerUpgradeAuthInstance, releaseUpgradeAuthInstance, upgradeAuthInstance, withAuth, } from './upgrade-auth.cjs';
16
- export { useUrlParams } from './url-params.cjs';
16
+ export { readParentChallengeIdFromURL, urlWithoutParentChallenge, useUrlParams } from './url-params.cjs';
17
17
  export { isValidUrl } from './validate-url.cjs';
18
18
  export * from './validation-schemas/index.cjs';
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- export { authErrorFor, authErrorFrom, authRedirectErrorFrom, authRedirectErrorMessage, emailCodeErrorMessage, invitationJoinErrorFrom, invitationLinkErrorMessage, isPasswordSavedRateLimit, newPasswordErrorMessage, serverMessageFor, verificationLinkErrorMessage, verificationRequestErrorMessage, } from './auth-error.js';
1
+ export { type ApprovalError, approvalAlreadyDecidedMessage, approvalApprovedMessage, approvalAttemptsMessage, approvalConnectionMessage, approvalDeniedMessage, approvalErrorFrom, approvalInvalidMessage, approvalUnavailableMessage, approvalUnknownErrorMessage, authErrorFor, authErrorFrom, authRedirectErrorFrom, authRedirectErrorMessage, emailCodeErrorMessage, invitationJoinErrorFrom, invitationLinkErrorMessage, isApprovalMatchError, isPasswordSavedRateLimit, newPasswordErrorMessage, passwordlessCompleteErrorMessage, passwordlessLinkExpiredMessage, passwordlessSignInFailedMessage, passwordlessWaitCompletedMessage, passwordlessWaitDeniedMessage, serverMessageFor, twoFactorBackToSignInLabel, twoFactorLinkAlreadyUsedMessage, twoFactorRateLimitedMessage, twoFactorSignInLabel, twoFactorWrongRecoveryCodeMessage, verificationLinkErrorMessage, verificationRequestErrorMessage, } from './auth-error.js';
2
2
  export { classifyDeviceError, DeviceApiError, deviceErrorOfType } from './classify-device-error.js';
3
- export { classifyTwoFactorError, getUserFriendlyErrorMessage } from './classify-two-factor-error.js';
3
+ export { classifyTwoFactorError, getUserFriendlyErrorMessage, isTerminalTwoFactorError } from './classify-two-factor-error.js';
4
4
  export { cn } from './cn.js';
5
5
  export * from './dayjs/index.js';
6
6
  export { type EmailCodeStepEvent, type EmailCodeStepState, emailCodeStepReducer, initialEmailCodeStepState, readEmailVerificationStep, } from './email-verification.js';
@@ -9,11 +9,11 @@ export { getIdentityLabel, getPasswordlessData, getValidationErrorsLabel } from
9
9
  export { getUrlErrors } from './get-url-errors.js';
10
10
  export { getUrlWithTokens, type TokenUrlFormat } from './get-url-with-tokens.js';
11
11
  export { getInvitationAuthChrome, type InvitationAuthIntent } from './invitation-auth-chrome.js';
12
- export { routeToSecondFactor, urlCarriesTwoFactorToken } from './second-factor.js';
12
+ export { routeToSecondFactor, signInSearch, urlCarriesTwoFactorToken } from './second-factor.js';
13
13
  export { TwoFactorLoopPrevention } from './two-factor-loop-prevention.js';
14
14
  export { undefinedOnCatch } from './undefined-on-catch.js';
15
15
  export { attachAuth, registerUpgradeAuthInstance, releaseUpgradeAuthInstance, upgradeAuthInstance, withAuth, } from './upgrade-auth.js';
16
- export { useUrlParams } from './url-params.js';
16
+ export { readParentChallengeIdFromURL, urlWithoutParentChallenge, useUrlParams } from './url-params.js';
17
17
  export { isValidUrl } from './validate-url.js';
18
18
  export * from './validation-schemas/index.js';
19
19
  //# sourceMappingURL=index.d.ts.map