@passflow/core 0.42.1 → 0.43.1

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,39 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### Version 0.43.1
6
+
7
+ - Fixed: `TwoFactorTrustedDevice` now describes every field of `GET /v2/user/2fa/trusted-devices`:
8
+ `trusted` (the device holds a grant that stands in for the second factor), `device_key`
9
+ (`TwoFactorTrustedDeviceKey`: `key_storage`, `enrolled_at`, `last_proof_at`) and `push_approval`
10
+ (`TwoFactorTrustedDevicePush`: `registered_at`). `expires_at` is now optional: the server leaves
11
+ it out on a device without a grant, one that only holds a device key or a push approval.
12
+ - Fixed: `TwoFactorSetupMagicLinkSession.reset` is `boolean`, not `boolean | undefined`; the SDK
13
+ always sets it.
14
+
15
+ ### Version 0.43.0
16
+
17
+ - Added: `passflow.devicePushProof(use, jti)` signs a push-approval device proof (`push_enrol`,
18
+ `push_info`, `push_approve`, `push_deny`) with the browser's enrolled device key and the next
19
+ counter value, the one key and counter that sign-in and refresh proofs use. It resolves
20
+ `undefined` with `deviceKey` off, in BFF mode, without IndexedDB or WebCrypto, or without an
21
+ enrolled key. `pushChallengeOf(challengeId, number?)` computes the `jti` the server expects for
22
+ `push_info`, `push_deny` and `push_approve`. New type `DevicePushProofUse`; `DeviceProofUse` now
23
+ includes the four push uses. See [docs/device-key.md](docs/device-key.md).
24
+ - Added: `passflow.twoFactor.pushStatus(challengeId)` (`POST /v2/auth/2fa/push/status`) reads the
25
+ state of a sign-in's push approval: `{ status: 'pending', expires_in_seconds }` or
26
+ `{ status: 'approved' }`. A denied, expired or unconfigured push rejects with `PassflowError`
27
+ (`error.2fa.push.denied`, `error.2fa.push.expired`, `error.2fa.push.not_configured`) and one
28
+ `Error` with operation `2fa.push.status`.
29
+ - Added: `TwoFactorChallengeResponse` carries `number_match` and `expires_in_seconds` on push
30
+ challenges.
31
+ - Added: `twoFactor.verifyV2({ challenge_id, method: 'push_webpush' })` finishes an approved push
32
+ sign-in. It sends no `response` key.
33
+ - Changed: `TwoFactorVerifyRequestV2` is now a union type, so a push completion needs no
34
+ `response` while every other method still must send one. Existing calls compile unchanged, but
35
+ `interface X extends TwoFactorVerifyRequestV2` no longer compiles; use an intersection
36
+ (`type X = TwoFactorVerifyRequestV2 & { … }`) instead.
37
+
5
38
  ### Version 0.42.1
6
39
 
7
40
  - Fixed: after a hosted sign-in through a SAML connection with SP-initiated logout,
@@ -1191,6 +1224,9 @@ switch (enrollment) {
1191
1224
  `expires_in_minutes`; `resend: true` sends a new code. Recovery codes for these users, the
1192
1225
  address-change proof and the discovery fields are in
1193
1226
  [docs/two-factor-codes.md](docs/two-factor-codes.md).
1227
+ - **Push approval.** A `push_webpush` challenge carries `number_match` and `expires_in_seconds`;
1228
+ poll `pushStatus(challengeId)`, then finish with `verifyV2({ challenge_id, method: 'push_webpush' })`
1229
+ and no `response`. See [docs/two-factor-codes.md](docs/two-factor-codes.md).
1194
1230
  - **The emailed link.** Call `validateTwoFactorSetupMagicLink(token)` on its page. While that session
1195
1231
  is active, `getTwoFactorStatus`, `beginTwoFactorSetup` and `confirmTwoFactorSetup` run on it instead
1196
1232
  of the stored session, and a correct confirm ends it. A used link reads as error code `ALREADY_USED`.