@passflow/core 0.49.0 → 0.49.2

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,14 +2,43 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### Version 0.49.2
6
+
7
+ Works with every Passflow server.
8
+
9
+ - Types: `PassflowGroup.default` is now optional (`default?: boolean`). The server leaves it out when the
10
+ group is not the tenant's default group. Code that reads it should treat a missing value as `false`;
11
+ `TenantUserMembership` already does.
12
+
13
+ ### Version 0.49.1
14
+
15
+ Works with every Passflow server.
16
+
17
+ - Fixed: `passflow.tenant.getTenantUserMembership()` threw `users_in_groups?.forEach is not a function`
18
+ for every tenant with members. The server sends `users_in_groups` as an object that maps a group id to
19
+ that group's members, and the SDK read it as an array.
20
+ - Types: `PassflowTenantResponse.users_in_groups` is now `Record<string, PassflowUserWithRoles[]>`.
21
+ `PassflowUserWithRoles` now describes what the server sends for one member: the user's profile fields
22
+ (`id`, `username`, `email`, `phone`, names, `picture`, `email_verified`, `phone_verified`), `roles`
23
+ (role id → role name) and `joined_via`. Its old fields (`user_id`, `phone_number`, `group_id`,
24
+ `role_id`, `tenant_id`) never came from the server. `PassflowUserInGroup` is deprecated: the server
25
+ never sends that shape.
26
+ - Breaking for types only: `PassflowUserWithRoles` and `PassflowTenantResponse.users_in_groups` change
27
+ shape, so code typed against the old fields (`users_in_groups[i].user`, `.group_id`, `user_id`,
28
+ `phone_number`) stops compiling. Such code never matched a server response; read the group-id map
29
+ instead, e.g. `Object.entries(details.users_in_groups ?? {})`.
30
+ - Changed: in `TenantUserMembership`, `User.name` is the display name: the preferred username, else the
31
+ given and family name, else the nickname, else the username, else `null`. The server sends no `name`
32
+ field. An empty email or phone is `null`. The rest of the return shape is unchanged.
33
+
5
34
  ### Version 0.49.0
6
35
 
7
36
  Emailed and texted codes at step-up need Passflow server src/v0.114.0 or later, which sends them
8
37
  from `POST /auth/upgrade/start` (and `POST /auth/session/upgrade/start` for the hosted session). An
9
38
  older server refuses the send; the SDK then drops that factor for the step-up and offers the others.
10
39
  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.
40
+ and sends nothing, so `resend` reports `resent: false` until that code is spent or expired. From
41
+ src/v0.154.0 on, the server honours `resend: true` for codes and sends a new code.
13
42
 
14
43
  - Added: step-up offers emailed and texted codes (`email_otp`, `sms_otp`). `DEFAULT_UPGRADE_FACTORS`
15
44
  is now TOTP, passkey, emailed code, texted code, recovery codes; the server's `available_factors`