@passflow/react 0.20.3 → 0.22.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 +14 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +145 -145
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/flow/consent/index.d.cts +1 -1
- package/dist/src/components/flow/consent/index.d.ts +1 -1
- package/dist/src/components/form/signed-in/index.d.ts.map +1 -1
- package/dist/src/components/provider/passflow-provider.d.ts.map +1 -1
- package/dist/src/hooks/use-consent.d.cts +9 -8
- package/dist/src/hooks/use-consent.d.ts +9 -8
- package/dist/src/hooks/use-consent.d.ts.map +1 -1
- package/dist/src/hooks/use-sign-in-ending.d.cts +4 -4
- package/dist/src/hooks/use-sign-in-ending.d.ts +4 -4
- package/dist/src/hooks/use-sign-in-ending.d.ts.map +1 -1
- package/dist/src/utils/auth-error.d.cts +17 -12
- package/dist/src/utils/auth-error.d.ts +17 -12
- package/dist/src/utils/auth-error.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import type { FC } from 'react';
|
|
|
3
3
|
* OIDC consent controller, mounted by the host app on `/web/consent`.
|
|
4
4
|
*
|
|
5
5
|
* Standalone by design: it needs no PassflowProvider. The staged request is
|
|
6
|
-
* addressed by `
|
|
6
|
+
* addressed by `consent_challenge_id` on the URL and read with a same-origin
|
|
7
7
|
* cookie, so there is no SDK client, no app settings lookup, and no token to
|
|
8
8
|
* hold — which is also why mounting it inside the provider would be actively
|
|
9
9
|
* wrong, since the provider's session-exchange probe would fire against a
|
|
@@ -3,7 +3,7 @@ import type { FC } from 'react';
|
|
|
3
3
|
* OIDC consent controller, mounted by the host app on `/web/consent`.
|
|
4
4
|
*
|
|
5
5
|
* Standalone by design: it needs no PassflowProvider. The staged request is
|
|
6
|
-
* addressed by `
|
|
6
|
+
* addressed by `consent_challenge_id` on the URL and read with a same-origin
|
|
7
7
|
* cookie, so there is no SDK client, no app settings lookup, and no token to
|
|
8
8
|
* hold — which is also why mounting it inside the provider would be actively
|
|
9
9
|
* wrong, since the provider's session-exchange probe would fire against a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signed-in/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/signed-in/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAmDpD,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC;IAAE,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAgBjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passflow-provider.d.ts","sourceRoot":"","sources":["../../../../src/components/provider/passflow-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,cAAc,EAKpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAiE,MAAM,OAAO,CAAC;AACtH,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAGpG,OAAO,EAML,KAAK,gBAAgB,EAIrB,KAAK,UAAU,EAEhB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,4BAA4B,EAAE,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC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AC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,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;AAiIF,eAAO,MAAM,mBAAmB,yCAE9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAoLtD,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The OIDC consent decision, as a hook.
|
|
3
3
|
*
|
|
4
|
-
* The URL is the bearer. `
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* The URL is the bearer. `consent_challenge_id` identifies the consent step the
|
|
5
|
+
* server staged for the user who just signed in, and that id is handed only to
|
|
6
|
+
* this browser, in the redirect that ends sign-in. Possessing it is what
|
|
7
|
+
* authorizes reading the staged request — there is no Authorization header on
|
|
8
|
+
* the GET. The server hands back a `csrf_token` with the request metadata, and
|
|
9
|
+
* every state-changing POST must carry it back in `X-Passflow-CSRF`. That token
|
|
10
|
+
* is the only thing separating a real decision from one a third-party page
|
|
11
|
+
* forged on the user's behalf, so it is never optional and never cached across
|
|
11
12
|
* challenges.
|
|
12
13
|
*
|
|
13
14
|
* The decision endpoints answer with a discriminated response rather than a
|
|
@@ -21,7 +22,7 @@ export type ConsentScopeMetadata = {
|
|
|
21
22
|
label: string;
|
|
22
23
|
description: string;
|
|
23
24
|
};
|
|
24
|
-
/** What GET /oidc/requests/{
|
|
25
|
+
/** What GET /oidc/requests/{consent_challenge_id} hands the page to render itself. */
|
|
25
26
|
export type ConsentInfo = {
|
|
26
27
|
client_id: string;
|
|
27
28
|
app_name: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The OIDC consent decision, as a hook.
|
|
3
3
|
*
|
|
4
|
-
* The URL is the bearer. `
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* The URL is the bearer. `consent_challenge_id` identifies the consent step the
|
|
5
|
+
* server staged for the user who just signed in, and that id is handed only to
|
|
6
|
+
* this browser, in the redirect that ends sign-in. Possessing it is what
|
|
7
|
+
* authorizes reading the staged request — there is no Authorization header on
|
|
8
|
+
* the GET. The server hands back a `csrf_token` with the request metadata, and
|
|
9
|
+
* every state-changing POST must carry it back in `X-Passflow-CSRF`. That token
|
|
10
|
+
* is the only thing separating a real decision from one a third-party page
|
|
11
|
+
* forged on the user's behalf, so it is never optional and never cached across
|
|
11
12
|
* challenges.
|
|
12
13
|
*
|
|
13
14
|
* The decision endpoints answer with a discriminated response rather than a
|
|
@@ -21,7 +22,7 @@ export type ConsentScopeMetadata = {
|
|
|
21
22
|
label: string;
|
|
22
23
|
description: string;
|
|
23
24
|
};
|
|
24
|
-
/** What GET /oidc/requests/{
|
|
25
|
+
/** What GET /oidc/requests/{consent_challenge_id} hands the page to render itself. */
|
|
25
26
|
export type ConsentInfo = {
|
|
26
27
|
client_id: string;
|
|
27
28
|
app_name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-consent.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-consent.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"use-consent.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-consent.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,oBAAoB,EAAE,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,EAAE,GAAG,OAAO,GAAG,WAAW,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAWF,MAAM,MAAM,aAAa;AACvB,mCAAmC;AACjC,SAAS;AACX,sDAAsD;GACpD,OAAO;AACT,+BAA+B;GAC7B,SAAS;AACX,uEAAuE;GACrE,aAAa;AACf,gFAAgF;GAC9E,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,aAAa,CAAC;IACtB,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACzB,yEAAyE;IACzE,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,mEAAmE;IACnE,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAC;IACvD,4DAA4D;IAC5D,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,2CAA2C;IAC3C,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B,CAAC;AA6BF,eAAO,MAAM,UAAU,QAAO,eAwJ7B,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export type SignInEnding = 'none' | 'checking' | 'signed-in' | 'refused' | 'unavailable';
|
|
1
|
+
export type SignInEnding = 'none' | 'checking' | 'signed-in' | 'refused' | 'unavailable' | 'service-unavailable';
|
|
2
2
|
/**
|
|
3
3
|
* How every sign-in ends once the user holds tokens, in this order:
|
|
4
4
|
* 1. With no target, or a target that is the sign-in page itself, the user stays and is told they are signed in.
|
|
5
5
|
* 2. A path on this page's origin is a plain navigation. It carries no tokens.
|
|
6
6
|
* 3. Anything else carries tokens. A target that came with the request (a prop, the URL, a token or a response) is
|
|
7
|
-
* validated by the server first and the user goes to the address it returns. If the server refuses, or
|
|
8
|
-
* nothing is sent: `ending` says which, and `retry` asks again. The app's own
|
|
9
|
-
* configuration and is not checked. The source decides, not the value.
|
|
7
|
+
* validated by the server first and the user goes to the address it returns. If the server refuses, fails, or
|
|
8
|
+
* Passflow cannot be reached at all, nothing is sent: `ending` says which, and `retry` asks again. The app's own
|
|
9
|
+
* default redirect is its operator's configuration and is not checked. The source decides, not the value.
|
|
10
10
|
*/
|
|
11
11
|
export declare const useSignInEnding: () => {
|
|
12
12
|
ending: SignInEnding;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export type SignInEnding = 'none' | 'checking' | 'signed-in' | 'refused' | 'unavailable';
|
|
1
|
+
export type SignInEnding = 'none' | 'checking' | 'signed-in' | 'refused' | 'unavailable' | 'service-unavailable';
|
|
2
2
|
/**
|
|
3
3
|
* How every sign-in ends once the user holds tokens, in this order:
|
|
4
4
|
* 1. With no target, or a target that is the sign-in page itself, the user stays and is told they are signed in.
|
|
5
5
|
* 2. A path on this page's origin is a plain navigation. It carries no tokens.
|
|
6
6
|
* 3. Anything else carries tokens. A target that came with the request (a prop, the URL, a token or a response) is
|
|
7
|
-
* validated by the server first and the user goes to the address it returns. If the server refuses, or
|
|
8
|
-
* nothing is sent: `ending` says which, and `retry` asks again. The app's own
|
|
9
|
-
* configuration and is not checked. The source decides, not the value.
|
|
7
|
+
* validated by the server first and the user goes to the address it returns. If the server refuses, fails, or
|
|
8
|
+
* Passflow cannot be reached at all, nothing is sent: `ending` says which, and `retry` asks again. The app's own
|
|
9
|
+
* default redirect is its operator's configuration and is not checked. The source decides, not the value.
|
|
10
10
|
*/
|
|
11
11
|
export declare const useSignInEnding: () => {
|
|
12
12
|
ending: SignInEnding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sign-in-ending.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-sign-in-ending.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-sign-in-ending.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-sign-in-ending.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,qBAAqB,CAAC;AAEjH;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;;+BAwBc,MAAM,GAAG,IAAI,eAAe,MAAM,GAAG,IAAI;CAqBlF,CAAC"}
|
|
@@ -13,7 +13,8 @@ export declare const SERVER_MESSAGE_ERROR_IDS: ReadonlySet<string>;
|
|
|
13
13
|
/**
|
|
14
14
|
* The server's own message for an allow-listed error id, trimmed; `null` for anything else. Duck-typed on
|
|
15
15
|
* `{ id, message }`, so it reads a `PassflowError`, a raw axios rejection's body, or a plain object such as a
|
|
16
|
-
* redirect's query.
|
|
16
|
+
* redirect's query. A request that Passflow did not answer (no response, or a gateway 502/503/504 without a Passflow
|
|
17
|
+
* body) carries core's service-unavailable id and always gets core's fixed message.
|
|
17
18
|
*/
|
|
18
19
|
export declare const serverMessageFor: (error: unknown) => string | null;
|
|
19
20
|
/** 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. */
|
|
@@ -31,9 +32,10 @@ export declare const emailCodeUnavailableMessage = "We couldn't check the code.
|
|
|
31
32
|
export declare const emailCodeRestartMessage = "We couldn't verify the code. Go back and start again.";
|
|
32
33
|
/**
|
|
33
34
|
* Error copy for the emailed-code step (`/auth/validate`, resend): allow-listed ids (wrong, expired or spent code,
|
|
34
|
-
* rate limit, ...) show the server message; `error.not.found`
|
|
35
|
-
*
|
|
36
|
-
* PKCE verifier, an unlisted 4xx or a 5xx) asks to start
|
|
35
|
+
* rate limit, ...) show the server message; Passflow being unavailable shows core's message; `error.not.found`
|
|
36
|
+
* (unknown or spent challenge) asks for a new code; a raw axios failure with no response (offline, CORS, timeout)
|
|
37
|
+
* asks to retry; every other server answer (401, a missing PKCE verifier, an unlisted 4xx or a 5xx) asks to start
|
|
38
|
+
* again, and the screen keeps its way back to the form.
|
|
37
39
|
*/
|
|
38
40
|
export declare const emailCodeErrorMessage: (error: unknown) => string;
|
|
39
41
|
export declare const passwordlessWaitDeniedMessage = "This sign-in was denied. Start again.";
|
|
@@ -56,15 +58,17 @@ export type ApprovalError = {
|
|
|
56
58
|
/** A wrong code on the approve screen: the tries left must be read again before showing the message. */
|
|
57
59
|
export declare const isApprovalMatchError: (error: unknown) => boolean;
|
|
58
60
|
/**
|
|
59
|
-
* Error copy for the approve screen. `attemptsLeft` is the count re-read after the rejection. A
|
|
60
|
-
*
|
|
61
|
+
* Error copy for the approve screen. `attemptsLeft` is the count re-read after the rejection. A request Passflow did
|
|
62
|
+
* not answer carries core's service-unavailable id; a plain core error with no response body may also arrive as id
|
|
63
|
+
* `error.passwordless.approval` or with status 0. Nothing was decided in either case, so the screen stays.
|
|
61
64
|
*/
|
|
62
65
|
export declare const approvalErrorFrom: (error: unknown, attemptsLeft?: number) => ApprovalError;
|
|
63
66
|
/**
|
|
64
|
-
* A failed passwordless completion. A row that only another device can approve has its own copy.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
67
|
+
* A failed passwordless completion. A row that only another device can approve has its own copy. Passflow being
|
|
68
|
+
* unavailable (core's service-unavailable id, on the completion or the exchange) shows core's message: nothing was
|
|
69
|
+
* refused, so the user can try again. A failed exchange that Passflow answered comes after the row was spent, so
|
|
70
|
+
* retrying cannot work (id `error.pkce.exchange`). A raw 429 on the completion itself arrives as id
|
|
71
|
+
* `error.passwordless.complete`: the code was not refused, so the user can try again.
|
|
68
72
|
*/
|
|
69
73
|
export declare const passwordlessCompleteErrorMessage: (error: unknown) => string;
|
|
70
74
|
export declare const resetLinkInvalidMessage = "This link is invalid or has expired. Request a new one.";
|
|
@@ -77,8 +81,9 @@ export declare const passwordSavedRateLimitedMessage = "Your password was saved,
|
|
|
77
81
|
export declare const isPasswordSavedRateLimit: (error: unknown) => boolean;
|
|
78
82
|
/**
|
|
79
83
|
* Error copy for the new-password screen (reset link or registration continuation): allow-listed ids show the server
|
|
80
|
-
* message; a refused or spent link (any other 4xx, an `error.token.*`
|
|
81
|
-
* failure asks to retry. The raw message of anything else is
|
|
84
|
+
* message; Passflow being unavailable shows core's message; a refused or spent link (any other 4xx, an `error.token.*`
|
|
85
|
+
* id) asks for a new one; any other server or network failure asks to retry. The raw message of anything else is
|
|
86
|
+
* never shown.
|
|
82
87
|
*/
|
|
83
88
|
export declare const newPasswordErrorMessage: (error: unknown) => string;
|
|
84
89
|
export declare const twoFactorSignInOverMessage = "Your sign-in has ended. Sign in again.";
|
|
@@ -13,7 +13,8 @@ export declare const SERVER_MESSAGE_ERROR_IDS: ReadonlySet<string>;
|
|
|
13
13
|
/**
|
|
14
14
|
* The server's own message for an allow-listed error id, trimmed; `null` for anything else. Duck-typed on
|
|
15
15
|
* `{ id, message }`, so it reads a `PassflowError`, a raw axios rejection's body, or a plain object such as a
|
|
16
|
-
* redirect's query.
|
|
16
|
+
* redirect's query. A request that Passflow did not answer (no response, or a gateway 502/503/504 without a Passflow
|
|
17
|
+
* body) carries core's service-unavailable id and always gets core's fixed message.
|
|
17
18
|
*/
|
|
18
19
|
export declare const serverMessageFor: (error: unknown) => string | null;
|
|
19
20
|
/** 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. */
|
|
@@ -31,9 +32,10 @@ export declare const emailCodeUnavailableMessage = "We couldn't check the code.
|
|
|
31
32
|
export declare const emailCodeRestartMessage = "We couldn't verify the code. Go back and start again.";
|
|
32
33
|
/**
|
|
33
34
|
* Error copy for the emailed-code step (`/auth/validate`, resend): allow-listed ids (wrong, expired or spent code,
|
|
34
|
-
* rate limit, ...) show the server message; `error.not.found`
|
|
35
|
-
*
|
|
36
|
-
* PKCE verifier, an unlisted 4xx or a 5xx) asks to start
|
|
35
|
+
* rate limit, ...) show the server message; Passflow being unavailable shows core's message; `error.not.found`
|
|
36
|
+
* (unknown or spent challenge) asks for a new code; a raw axios failure with no response (offline, CORS, timeout)
|
|
37
|
+
* asks to retry; every other server answer (401, a missing PKCE verifier, an unlisted 4xx or a 5xx) asks to start
|
|
38
|
+
* again, and the screen keeps its way back to the form.
|
|
37
39
|
*/
|
|
38
40
|
export declare const emailCodeErrorMessage: (error: unknown) => string;
|
|
39
41
|
export declare const passwordlessWaitDeniedMessage = "This sign-in was denied. Start again.";
|
|
@@ -56,15 +58,17 @@ export type ApprovalError = {
|
|
|
56
58
|
/** A wrong code on the approve screen: the tries left must be read again before showing the message. */
|
|
57
59
|
export declare const isApprovalMatchError: (error: unknown) => boolean;
|
|
58
60
|
/**
|
|
59
|
-
* Error copy for the approve screen. `attemptsLeft` is the count re-read after the rejection. A
|
|
60
|
-
*
|
|
61
|
+
* Error copy for the approve screen. `attemptsLeft` is the count re-read after the rejection. A request Passflow did
|
|
62
|
+
* not answer carries core's service-unavailable id; a plain core error with no response body may also arrive as id
|
|
63
|
+
* `error.passwordless.approval` or with status 0. Nothing was decided in either case, so the screen stays.
|
|
61
64
|
*/
|
|
62
65
|
export declare const approvalErrorFrom: (error: unknown, attemptsLeft?: number) => ApprovalError;
|
|
63
66
|
/**
|
|
64
|
-
* A failed passwordless completion. A row that only another device can approve has its own copy.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
67
|
+
* A failed passwordless completion. A row that only another device can approve has its own copy. Passflow being
|
|
68
|
+
* unavailable (core's service-unavailable id, on the completion or the exchange) shows core's message: nothing was
|
|
69
|
+
* refused, so the user can try again. A failed exchange that Passflow answered comes after the row was spent, so
|
|
70
|
+
* retrying cannot work (id `error.pkce.exchange`). A raw 429 on the completion itself arrives as id
|
|
71
|
+
* `error.passwordless.complete`: the code was not refused, so the user can try again.
|
|
68
72
|
*/
|
|
69
73
|
export declare const passwordlessCompleteErrorMessage: (error: unknown) => string;
|
|
70
74
|
export declare const resetLinkInvalidMessage = "This link is invalid or has expired. Request a new one.";
|
|
@@ -77,8 +81,9 @@ export declare const passwordSavedRateLimitedMessage = "Your password was saved,
|
|
|
77
81
|
export declare const isPasswordSavedRateLimit: (error: unknown) => boolean;
|
|
78
82
|
/**
|
|
79
83
|
* Error copy for the new-password screen (reset link or registration continuation): allow-listed ids show the server
|
|
80
|
-
* message; a refused or spent link (any other 4xx, an `error.token.*`
|
|
81
|
-
* failure asks to retry. The raw message of anything else is
|
|
84
|
+
* message; Passflow being unavailable shows core's message; a refused or spent link (any other 4xx, an `error.token.*`
|
|
85
|
+
* id) asks for a new one; any other server or network failure asks to retry. The raw message of anything else is
|
|
86
|
+
* never shown.
|
|
82
87
|
*/
|
|
83
88
|
export declare const newPasswordErrorMessage: (error: unknown) => string;
|
|
84
89
|
export declare const twoFactorSignInOverMessage = "Your sign-in has ended. Sign in again.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-error.d.ts","sourceRoot":"","sources":["../../../src/utils/auth-error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth-error.d.ts","sourceRoot":"","sources":["../../../src/utils/auth-error.ts"],"names":[],"mappings":"AACA,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,CAAC,MAAM,CAavD,CAAC;AAkBH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,OAAO,KAAG,MAAM,GAAG,IAS1D,CAAC;AASF,qIAAqI;AACrI,eAAO,MAAM,aAAa,UAAW,OAAO,QAAQ,QAAQ,aAAa,aAAa,KAAG,WAMxF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,UAAW,MAAM,WAAW,MAAM,GAAG,IAAI,KAAG,MACR,CAAC;AAEvE,eAAO,MAAM,0BAA0B,mDAAmD,CAAC;AAE3F,+FAA+F;AAC/F,eAAO,MAAM,uBAAuB,UAAW,OAAO,KAAG,MAA+D,CAAC;AAEzH,eAAO,MAAM,uBAAuB,sDAAsD,CAAC;AAC3F,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AACpF,eAAO,MAAM,uBAAuB,0DAA0D,CAAC;AAE/F;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,UAAW,OAAO,KAAG,MAUtD,CAAC;AAGF,eAAO,MAAM,6BAA6B,0CAA0C,CAAC;AACrF,eAAO,MAAM,8BAA8B,oCAAoC,CA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CAA4C,CAAC;AACrF,eAAO,MAAM,yBAAyB,qEAAqE,CAAC;AAC5G,eAAO,MAAM,iCAAiC,2BAA2B,CAAC;AAC1E,eAAO,MAAM,0BAA0B,gHACwE,CAAC;AAChH,eAAO,MAAM,0BAA0B,sFAAsF,CAAC;AAC9H,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,+BAA+B,yCAAyC,CAAC;AACtF,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,cAAc,GACd,YAAY,GACZ,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@passflow/react",
|
|
3
3
|
"description": "Passflow React UI Kit",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.22.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@passflow/core": "^0.
|
|
53
|
+
"@passflow/core": "^0.28.0",
|
|
54
54
|
"@radix-ui/react-dialog": "^1.3.1",
|
|
55
55
|
"@radix-ui/react-popover": "^1.3.1",
|
|
56
56
|
"@simplewebauthn/browser": "^14.0.0",
|