@passflow/core 0.39.1 → 0.39.3

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/README.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### Version 0.39.3
6
+
7
+ - Changed: a sign-in that lands with tokens in the URL also removes `user_state` from the address
8
+ bar, as the federated landing already did. An app that read `user_state` from the URL after
9
+ `handleTokensRedirect()` no longer finds it there.
10
+ - Docs: after `confirmTwoFactorEnrollment`, `verifyTwoFactor` takes the next authenticator code; the
11
+ server accepts each code only once.
12
+
13
+ ### Version 0.39.2
14
+
15
+ - Added: `challenge` on `PassflowSmsQuotaExceededError` and `PassflowSendLimitError`
16
+ (`TwoFactorSendRefusalChallenge`: `challenge_id`, `suggested_method`, `alternative_methods`) when
17
+ the refused send's 429 body carries a `challenge_id`, so the sign-in can go on with another
18
+ method. Undefined otherwise.
19
+
5
20
  ### Version 0.39.1
6
21
 
7
22
  - Changed: errors the SDK passes on carry no request data. A rejected `AxiosError` that reaches the
@@ -1016,7 +1031,7 @@ switch (enrollment) {
1016
1031
  case "direct": { // no factor, no validated email: enrol on this sign-in
1017
1032
  const setup = await passflow.beginTwoFactorEnrollment(); // setup.secret, setup.qr_code (base64 PNG)
1018
1033
  const { recovery_codes } = await passflow.confirmTwoFactorEnrollment(code); // show these once
1019
- await passflow.verifyTwoFactor(code); // the same code finishes the sign-in
1034
+ await passflow.verifyTwoFactor(nextCode); // the next authenticator code finishes the sign-in
1020
1035
  break;
1021
1036
  }
1022
1037
  case "unavailable": // no way to enrol here: tell the user to contact the administrator
@@ -1173,8 +1188,8 @@ const handleRedirect = () => {
1173
1188
  };
1174
1189
  ```
1175
1190
 
1176
- `handleTokensRedirect()` returns nothing. It removes the tokens (and their `state`) from the URL at
1177
- once; the other query and fragment params stay. Core accepts URL tokens only for apps in Simple mode:
1191
+ `handleTokensRedirect()` returns nothing. It removes the tokens (and their `state`), `client_challenge`
1192
+ and `user_state` from the URL at once; the other query and fragment params stay. Core accepts URL tokens only for apps in Simple mode:
1178
1193
  it reads the app settings first, and an app in SDK mode, an instance with no app id, or a failed read
1179
1194
  ends in `Error` with operation `tokens.from-url` and code `TOKENS_IN_URL_NOT_ALLOWED`, with nothing
1180
1195
  saved. For a Simple app it then verifies the tokens in the background before saving them: each signature against the keys at