@passflow/core 0.48.0 → 0.49.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/README.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### Version 0.49.0
6
+
7
+ Emailed and texted codes at step-up need Passflow server src/v0.114.0 or later, which sends them
8
+ from `POST /auth/upgrade/start` (and `POST /auth/session/upgrade/start` for the hosted session). An
9
+ older server refuses the send; the SDK then drops that factor for the step-up and offers the others.
10
+ From src/v0.115.0 up to src/v0.153.2, a start while the code is live answers with that code again
11
+ and sends nothing, so `resend` reports `resent: false` until that code is spent or expired. The
12
+ server release after src/v0.153.2 honours `resend: true` for codes and sends a new code.
13
+
14
+ - Added: step-up offers emailed and texted codes (`email_otp`, `sms_otp`). `DEFAULT_UPGRADE_FACTORS`
15
+ is now TOTP, passkey, emailed code, texted code, recovery codes; the server's `available_factors`
16
+ order still wins. New exports `emailOtpFactor` and `smsOtpFactor`.
17
+ - Added: the code is asked for when the user picks the factor (`onFactorSelected`), not after the
18
+ answer. `UpgradePromptRequest` gains `resend(factor)` (asks with `resend: true`, resolves with
19
+ `UpgradeCodeSent`), an `onCodeSent` slot (called on every answer) and `codeSent` (set on a
20
+ re-opened prompt). New type `UpgradeCodeSent`: `{ factor, codeSentTo?, expiresAt, resent }`;
21
+ `resent` is false when the server answered with the live code again. A prompt left open after its
22
+ step-up ended sends nothing.
23
+ - Added: `UpgradeStartPayload.resend` and a second `options` argument to `UpgradeTransport.prepare`.
24
+ - A wrong code re-opens the prompt on the same challenge, with no new code. A spent or expired code
25
+ (`error.upgrade.challenge_invalid`) gets one new code before the prompt re-opens; a refused new
26
+ code ends the step-up with its own error. A refused resend keeps the code held before. A prompt
27
+ that ignores the new fields still works: its first answer asks for the code. See
28
+ [docs/two-factor-codes.md](docs/two-factor-codes.md#codes-at-step-up).
29
+ - Docs: `PassflowSessionDevice.last_seen` is the device's last request, shared by every session of
30
+ that device, not the session's own.
31
+
32
+ ### Version 0.48.1
33
+
34
+ Works with every Passflow server.
35
+
36
+ - Fixed: `googleNativeAvailable()` answered `false`, and `googleNativeSignIn` failed with
37
+ `'unsupported'`, in a Chrome where an extension (a password manager, for example) wraps
38
+ `navigator.credentials.get`. The SDK no longer calls `get` to find out whether FedCM is there.
39
+ It now reads `IdentityCredential`, whether `navigator.credentials.get` exists, and the Chromium
40
+ version (132 or later, from `navigator.userAgentData` or the user agent string). Other browsers
41
+ stay unsupported. A browser that passes the check but refuses the request still fails at
42
+ sign-in with `NativeSignInError`.
43
+
5
44
  ### Version 0.48.0
6
45
 
7
46
  Works with every Passflow server. The server sends `attack_protection.challenge` from
@@ -1271,7 +1310,9 @@ switch (enrollment) {
1271
1310
  are kept.
1272
1311
  - **Step-up offers what the server lists.** The step-up 403 from `/auth/session/exchange` carries
1273
1312
  `available_factors`, the factors this user can step up with, and the SDK offers exactly those in
1274
- that order. Without it (older servers), TOTP is suggested before passkey. When the list is empty,
1313
+ that order, emailed and texted codes included (see
1314
+ [docs/two-factor-codes.md](docs/two-factor-codes.md#codes-at-step-up)). Without it (older servers),
1315
+ the order is TOTP, passkey, emailed code, texted code, recovery codes. When the list is empty,
1275
1316
  no prompt opens and an open prompt is closed (its `onClosed` is called). The body's
1276
1317
  `sign_in_required` says why:
1277
1318
  - `true`: no step-up can meet the requirement, and the user must sign in again (`prompt=login`,