@passflow/core 0.39.2 → 0.39.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -3414,7 +3414,7 @@ export declare class TwoFactorApiClient {
3414
3414
  */
3415
3415
  beginEnrollment(tfaToken: string): Promise<TwoFactorSetupResponse>;
3416
3416
  /**
3417
- * Confirm 2FA setup on the sign-in itself; `verify` with the same code then finishes it
3417
+ * Confirm 2FA setup on the sign-in itself; `verify` with the next authenticator code then finishes it
3418
3418
  * POST /auth/2fa/setup/confirm
3419
3419
  */
3420
3420
  confirmEnrollment(tfaToken: string, payload: TwoFactorConfirmRequest): Promise<TwoFactorConfirmResponse>;
@@ -5240,7 +5240,7 @@ export declare class TwoFactorService {
5240
5240
  beginEnrollment(): Promise<TwoFactorSetupResponse>;
5241
5241
  /**
5242
5242
  * Confirm 2FA setup on the sign-in itself (`direct`). The sign-in stays pending:
5243
- * show the recovery codes, then `verify` with the same code finishes it.
5243
+ * show the recovery codes, then `verify` with the next authenticator code finishes it.
5244
5244
  */
5245
5245
  confirmEnrollment(code: string): Promise<TwoFactorConfirmResponse>;
5246
5246
  /**
@@ -6644,16 +6644,16 @@ export declare class Passflow {
6644
6644
  /**
6645
6645
  * Adopts a `#tfa_token=` fragment: the 2FA token goes to the TwoFactorService
6646
6646
  * through `TwoFactorRequired`, exactly as a password sign-in's does, and the
6647
- * fragment is stripped from the URL. Nothing is saved as a session.
6647
+ * token and `user_state` leave the URL. Nothing is saved as a session.
6648
6648
  *
6649
6649
  * @returns true when the URL carried a 2FA token
6650
6650
  */
6651
6651
  private adoptTwoFactorTokenFromUrl;
6652
6652
  private checkErrorsFromURL;
6653
6653
  /**
6654
- * When a token appears in the query or the fragment, removes every token and `client_challenge`
6655
- * from the query, and the tokens, `client_challenge` and `state` from whichever part carried the
6656
- * tokens, in one history replace. Other params stay, in the query and in the fragment.
6654
+ * When a token appears in the query or the fragment, removes every token, `client_challenge` and
6655
+ * `user_state` from the query, and those and `state` from whichever part carried the tokens, in
6656
+ * one history replace. Other params stay, in the query and in the fragment.
6657
6657
  */
6658
6658
  private cleanupUrlParams;
6659
6659
  private setTokensToCacheFromLocalStorage;
@@ -7796,7 +7796,7 @@ export declare class Passflow {
7796
7796
  beginTwoFactorEnrollment(): Promise<TwoFactorSetupResponse>;
7797
7797
  /**
7798
7798
  * Confirm 2FA setup on the pending sign-in. The sign-in stays pending: show the recovery codes,
7799
- * then `verifyTwoFactor` with the same code finishes it.
7799
+ * then `verifyTwoFactor` with the next authenticator code finishes it.
7800
7800
  *
7801
7801
  * @param code - TOTP code from the authenticator app
7802
7802
  * @returns Promise with the recovery codes the user must save
package/dist/index.d.ts CHANGED
@@ -3414,7 +3414,7 @@ export declare class TwoFactorApiClient {
3414
3414
  */
3415
3415
  beginEnrollment(tfaToken: string): Promise<TwoFactorSetupResponse>;
3416
3416
  /**
3417
- * Confirm 2FA setup on the sign-in itself; `verify` with the same code then finishes it
3417
+ * Confirm 2FA setup on the sign-in itself; `verify` with the next authenticator code then finishes it
3418
3418
  * POST /auth/2fa/setup/confirm
3419
3419
  */
3420
3420
  confirmEnrollment(tfaToken: string, payload: TwoFactorConfirmRequest): Promise<TwoFactorConfirmResponse>;
@@ -5240,7 +5240,7 @@ export declare class TwoFactorService {
5240
5240
  beginEnrollment(): Promise<TwoFactorSetupResponse>;
5241
5241
  /**
5242
5242
  * Confirm 2FA setup on the sign-in itself (`direct`). The sign-in stays pending:
5243
- * show the recovery codes, then `verify` with the same code finishes it.
5243
+ * show the recovery codes, then `verify` with the next authenticator code finishes it.
5244
5244
  */
5245
5245
  confirmEnrollment(code: string): Promise<TwoFactorConfirmResponse>;
5246
5246
  /**
@@ -6644,16 +6644,16 @@ export declare class Passflow {
6644
6644
  /**
6645
6645
  * Adopts a `#tfa_token=` fragment: the 2FA token goes to the TwoFactorService
6646
6646
  * through `TwoFactorRequired`, exactly as a password sign-in's does, and the
6647
- * fragment is stripped from the URL. Nothing is saved as a session.
6647
+ * token and `user_state` leave the URL. Nothing is saved as a session.
6648
6648
  *
6649
6649
  * @returns true when the URL carried a 2FA token
6650
6650
  */
6651
6651
  private adoptTwoFactorTokenFromUrl;
6652
6652
  private checkErrorsFromURL;
6653
6653
  /**
6654
- * When a token appears in the query or the fragment, removes every token and `client_challenge`
6655
- * from the query, and the tokens, `client_challenge` and `state` from whichever part carried the
6656
- * tokens, in one history replace. Other params stay, in the query and in the fragment.
6654
+ * When a token appears in the query or the fragment, removes every token, `client_challenge` and
6655
+ * `user_state` from the query, and those and `state` from whichever part carried the tokens, in
6656
+ * one history replace. Other params stay, in the query and in the fragment.
6657
6657
  */
6658
6658
  private cleanupUrlParams;
6659
6659
  private setTokensToCacheFromLocalStorage;
@@ -7796,7 +7796,7 @@ export declare class Passflow {
7796
7796
  beginTwoFactorEnrollment(): Promise<TwoFactorSetupResponse>;
7797
7797
  /**
7798
7798
  * Confirm 2FA setup on the pending sign-in. The sign-in stays pending: show the recovery codes,
7799
- * then `verifyTwoFactor` with the same code finishes it.
7799
+ * then `verifyTwoFactor` with the next authenticator code finishes it.
7800
7800
  *
7801
7801
  * @param code - TOTP code from the authenticator app
7802
7802
  * @returns Promise with the recovery codes the user must save
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ var a = "__passflowAntiBot", o = (e, t) => {
11
11
  if (typeof e != "object" || !e) return;
12
12
  let t = e[a];
13
13
  return typeof t == "object" && t ? t : void 0;
14
- }, c = "0.39.2", l = "X-Passflow-Clientid", u = "Authorization", d = "X-Passflow-DeviceId", f = "X-Passflow-DeviceType", p = "X-Passflow-Anti-Bot", m = "X-Passflow-Agent-Tool", h = "passflow_auth", g = c, _ = [
14
+ }, c = "0.39.4", l = "X-Passflow-Clientid", u = "Authorization", d = "X-Passflow-DeviceId", f = "X-Passflow-DeviceType", p = "X-Passflow-Anti-Bot", m = "X-Passflow-Agent-Tool", h = "passflow_auth", g = c, _ = [
15
15
  "id",
16
16
  "offline",
17
17
  "openid"
@@ -7528,8 +7528,10 @@ var Ea = 10, Da = "The sign-in answered with a PKCE code, but its verifier is go
7528
7528
  let t = new URLSearchParams(e.hash.substring(1)), n = t.get("tfa_token");
7529
7529
  if (!n) return !1;
7530
7530
  t.delete("tfa_token");
7531
- let r = t.toString();
7532
- return this.platform.replaceUrl(e.pathname + e.search + (r ? `#${r}` : "")), la(n) ? (this.subscribeStore.notify(W.TwoFactorRequired, {
7531
+ let r = t.toString(), i = new URLSearchParams(e.search);
7532
+ i.delete("user_state");
7533
+ let a = i.toString();
7534
+ return this.platform.replaceUrl(e.pathname + (a ? `?${a}` : "") + (r ? `#${r}` : "")), la(n) ? (this.subscribeStore.notify(W.TwoFactorRequired, {
7533
7535
  email: "",
7534
7536
  challengeId: "",
7535
7537
  tfaToken: n
@@ -7554,22 +7556,19 @@ var Ea = 10, Da = "The sign-in answered with a PKCE code, but its verifier is go
7554
7556
  "id_token"
7555
7557
  ], n = new URLSearchParams(e.search), r = new URLSearchParams(e.hash?.substring(1)), i = t.some((e) => n.get(e)), a = t.some((e) => r.get(e));
7556
7558
  if (!a && !i) return;
7557
- for (let e of [
7559
+ let o = [
7558
7560
  ...t,
7559
7561
  "client_challenge",
7560
- ...i ? ["state"] : []
7561
- ]) n.delete(e);
7562
- let o = n.toString(), s = e.hash ?? "";
7562
+ "user_state"
7563
+ ];
7564
+ for (let e of [...o, ...i ? ["state"] : []]) n.delete(e);
7565
+ let s = n.toString(), c = e.hash ?? "";
7563
7566
  if (a) {
7564
- for (let e of [
7565
- ...t,
7566
- "client_challenge",
7567
- "state"
7568
- ]) r.delete(e);
7567
+ for (let e of [...o, "state"]) r.delete(e);
7569
7568
  let e = r.toString();
7570
- s = e ? `#${e}` : "";
7569
+ c = e ? `#${e}` : "";
7571
7570
  }
7572
- this.platform.replaceUrl(e.pathname + (o ? `?${o}` : "") + s);
7571
+ this.platform.replaceUrl(e.pathname + (s ? `?${s}` : "") + c);
7573
7572
  }
7574
7573
  setTokensToCacheFromLocalStorage() {
7575
7574
  let e = this.storageManager.getTokens();