@passflow/core 0.48.1 → 0.49.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 +51 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +106 -20
- package/dist/index.d.ts +106 -20
- package/dist/index.mjs +335 -250
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
## Changelog
|
|
4
4
|
|
|
5
|
+
### Version 0.49.1
|
|
6
|
+
|
|
7
|
+
Works with every Passflow server.
|
|
8
|
+
|
|
9
|
+
- Fixed: `passflow.tenant.getTenantUserMembership()` threw `users_in_groups?.forEach is not a function`
|
|
10
|
+
for every tenant with members. The server sends `users_in_groups` as an object that maps a group id to
|
|
11
|
+
that group's members, and the SDK read it as an array.
|
|
12
|
+
- Types: `PassflowTenantResponse.users_in_groups` is now `Record<string, PassflowUserWithRoles[]>`.
|
|
13
|
+
`PassflowUserWithRoles` now describes what the server sends for one member: the user's profile fields
|
|
14
|
+
(`id`, `username`, `email`, `phone`, names, `picture`, `email_verified`, `phone_verified`), `roles`
|
|
15
|
+
(role id → role name) and `joined_via`. Its old fields (`user_id`, `phone_number`, `group_id`,
|
|
16
|
+
`role_id`, `tenant_id`) never came from the server. `PassflowUserInGroup` is deprecated: the server
|
|
17
|
+
never sends that shape.
|
|
18
|
+
- Breaking for types only: `PassflowUserWithRoles` and `PassflowTenantResponse.users_in_groups` change
|
|
19
|
+
shape, so code typed against the old fields (`users_in_groups[i].user`, `.group_id`, `user_id`,
|
|
20
|
+
`phone_number`) stops compiling. Such code never matched a server response; read the group-id map
|
|
21
|
+
instead, e.g. `Object.entries(details.users_in_groups ?? {})`.
|
|
22
|
+
- Changed: in `TenantUserMembership`, `User.name` is the display name: the preferred username, else the
|
|
23
|
+
given and family name, else the nickname, else the username, else `null`. The server sends no `name`
|
|
24
|
+
field. An empty email or phone is `null`. The rest of the return shape is unchanged.
|
|
25
|
+
|
|
26
|
+
### Version 0.49.0
|
|
27
|
+
|
|
28
|
+
Emailed and texted codes at step-up need Passflow server src/v0.114.0 or later, which sends them
|
|
29
|
+
from `POST /auth/upgrade/start` (and `POST /auth/session/upgrade/start` for the hosted session). An
|
|
30
|
+
older server refuses the send; the SDK then drops that factor for the step-up and offers the others.
|
|
31
|
+
From src/v0.115.0 up to src/v0.153.2, a start while the code is live answers with that code again
|
|
32
|
+
and sends nothing, so `resend` reports `resent: false` until that code is spent or expired. From
|
|
33
|
+
src/v0.154.0 on, the server honours `resend: true` for codes and sends a new code.
|
|
34
|
+
|
|
35
|
+
- Added: step-up offers emailed and texted codes (`email_otp`, `sms_otp`). `DEFAULT_UPGRADE_FACTORS`
|
|
36
|
+
is now TOTP, passkey, emailed code, texted code, recovery codes; the server's `available_factors`
|
|
37
|
+
order still wins. New exports `emailOtpFactor` and `smsOtpFactor`.
|
|
38
|
+
- Added: the code is asked for when the user picks the factor (`onFactorSelected`), not after the
|
|
39
|
+
answer. `UpgradePromptRequest` gains `resend(factor)` (asks with `resend: true`, resolves with
|
|
40
|
+
`UpgradeCodeSent`), an `onCodeSent` slot (called on every answer) and `codeSent` (set on a
|
|
41
|
+
re-opened prompt). New type `UpgradeCodeSent`: `{ factor, codeSentTo?, expiresAt, resent }`;
|
|
42
|
+
`resent` is false when the server answered with the live code again. A prompt left open after its
|
|
43
|
+
step-up ended sends nothing.
|
|
44
|
+
- Added: `UpgradeStartPayload.resend` and a second `options` argument to `UpgradeTransport.prepare`.
|
|
45
|
+
- A wrong code re-opens the prompt on the same challenge, with no new code. A spent or expired code
|
|
46
|
+
(`error.upgrade.challenge_invalid`) gets one new code before the prompt re-opens; a refused new
|
|
47
|
+
code ends the step-up with its own error. A refused resend keeps the code held before. A prompt
|
|
48
|
+
that ignores the new fields still works: its first answer asks for the code. See
|
|
49
|
+
[docs/two-factor-codes.md](docs/two-factor-codes.md#codes-at-step-up).
|
|
50
|
+
- Docs: `PassflowSessionDevice.last_seen` is the device's last request, shared by every session of
|
|
51
|
+
that device, not the session's own.
|
|
52
|
+
|
|
5
53
|
### Version 0.48.1
|
|
6
54
|
|
|
7
55
|
Works with every Passflow server.
|
|
@@ -1283,7 +1331,9 @@ switch (enrollment) {
|
|
|
1283
1331
|
are kept.
|
|
1284
1332
|
- **Step-up offers what the server lists.** The step-up 403 from `/auth/session/exchange` carries
|
|
1285
1333
|
`available_factors`, the factors this user can step up with, and the SDK offers exactly those in
|
|
1286
|
-
that order
|
|
1334
|
+
that order, emailed and texted codes included (see
|
|
1335
|
+
[docs/two-factor-codes.md](docs/two-factor-codes.md#codes-at-step-up)). Without it (older servers),
|
|
1336
|
+
the order is TOTP, passkey, emailed code, texted code, recovery codes. When the list is empty,
|
|
1287
1337
|
no prompt opens and an open prompt is closed (its `onClosed` is called). The body's
|
|
1288
1338
|
`sign_in_required` says why:
|
|
1289
1339
|
- `true`: no step-up can meet the requirement, and the user must sign in again (`prompt=login`,
|