@passflow/core 0.35.0 → 0.35.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 +74 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -27
- package/dist/index.d.ts +31 -27
- package/dist/index.mjs +300 -278
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,79 @@
|
|
|
2
2
|
|
|
3
3
|
## Changelog
|
|
4
4
|
|
|
5
|
+
### Version 0.35.2
|
|
6
|
+
|
|
7
|
+
- Fixed: the cookie and BFF session is stored per app. The session state, delivery mode, CSRF token
|
|
8
|
+
and cookie-mode ID token are kept under `passflow_session_state:<appId>`,
|
|
9
|
+
`passflow_delivery_mode:<appId>`, `passflow_csrf_token:<appId>` and `passflow_id_token:<appId>`,
|
|
10
|
+
so two apps on one origin no longer change each other's session: one app's sign-in, sign-out or
|
|
11
|
+
delivery mode leaves the other's alone. With no app id the keys are unchanged. Values stored by
|
|
12
|
+
an earlier version under the plain keys are not read once an app id is set. After updating, users
|
|
13
|
+
of an app that sets an app id and uses cookie or BFF delivery sign in once again. `setAppId()`
|
|
14
|
+
reads the delivery mode and session state of the new app.
|
|
15
|
+
- Fixed: in cookie mode the session check on load (`GET /user/me`) takes a 2xx answer that holds the
|
|
16
|
+
user (an object with an `id`) as a valid session and passes that user to `SessionRestored`. It
|
|
17
|
+
looked for a `valid` field the server does not send, so every load marked a good session invalid
|
|
18
|
+
and `isAuthenticated()` returned false. A 2xx with any other body, a 401, any other error or a
|
|
19
|
+
network failure marks the session invalid. `PassflowSessionValidationResponse` is replaced by
|
|
20
|
+
`PassflowSessionUser`, the user object.
|
|
21
|
+
|
|
22
|
+
### Version 0.35.1
|
|
23
|
+
|
|
24
|
+
- Fixed: a federated start that answers with an `auth_url` (a `human_only` app, or the `agentTool`
|
|
25
|
+
option) is followed only when the address is `http` or `https`. Any other address fails the start
|
|
26
|
+
with an `Error` whose operation is `federated.redirect` or `federated.popup`, and a pending popup
|
|
27
|
+
is closed.
|
|
28
|
+
|
|
29
|
+
### Version 0.35.0
|
|
30
|
+
|
|
31
|
+
- Fixed: a session with an access token and no refresh token stays signed in when the page becomes
|
|
32
|
+
visible again and when another tab signs the same user in. It ends when its access token is gone
|
|
33
|
+
from storage, when the user signs out, or when another user signs in.
|
|
34
|
+
- Changed: a new session (a sign-in, tokens in the URL, `setTokens()`) replaces the stored one. A
|
|
35
|
+
call to `setTokens()` with only a new access token drops the stored refresh token, ID token and
|
|
36
|
+
scopes. Pass every token you want to keep; read the current ones with `getTokens()` or
|
|
37
|
+
`getCachedTokens()`.
|
|
38
|
+
- A tab that holds a refresh token gets `SignOut` with origin `other-tab` after 2 s when another tab
|
|
39
|
+
replaces the session with one that has no refresh token.
|
|
40
|
+
- `getTokens(true)` and `session({ doRefresh: true })` resolve `undefined` for an expired access
|
|
41
|
+
token with no refresh token, so `expiredSession` is called.
|
|
42
|
+
|
|
43
|
+
### Version 0.34.0
|
|
44
|
+
|
|
45
|
+
- App settings carry `bot_mode` and `anti_bot`. On a `human_only` app the SDK adds
|
|
46
|
+
`X-Passflow-Anti-Bot` to the covered sign-in calls: login, register, passwordless start, passkey
|
|
47
|
+
register and authenticate start, password reset send and federated start. The value is a built-in
|
|
48
|
+
proof of work, solved in `dist/anti-bot-worker.js` (`antiBotWorkerUrl`) or on the main thread, or
|
|
49
|
+
a token from `setAntiBotTokenProvider()`. A `bot_friendly` app, or an unknown bot mode, sends the
|
|
50
|
+
same requests as before. See [docs/anti-bot.md](docs/anti-bot.md).
|
|
51
|
+
- `antiBotToken()` gives the header value for calls the SDK does not make itself. The per-call
|
|
52
|
+
`agentTool` option sends `X-Passflow-Agent-Tool: 1`. New events: `anti-bot:solving` and
|
|
53
|
+
`anti-bot:solved`.
|
|
54
|
+
- A challenge whose `max` is above 5,000,000 is refused, and a solve still running after 60 s is
|
|
55
|
+
stopped. Both reject with `error.anti_bot.solve_failed`.
|
|
56
|
+
- Fixed: `federatedAuthWithPopup` opens the popup inside the click, before any request, and fills in
|
|
57
|
+
the address afterwards, so a slow settings read no longer gets the popup blocked.
|
|
58
|
+
|
|
59
|
+
### Version 0.33.0
|
|
60
|
+
|
|
61
|
+
- `listSessions()` lists the signed-in user's sessions; the caller's own has `current: true`.
|
|
62
|
+
`revokeSession(sessionId)` ends one; ending the session this instance is signed in with signs out
|
|
63
|
+
like `logOut()`. `signOutOtherSessions()` ends every other session and resolves to `{ revoked }`.
|
|
64
|
+
- New types: `PassflowUserSession`, `PassflowSessionDevice`, `PassflowUserSessionList` and
|
|
65
|
+
`PassflowRevokeOtherSessionsResponse`. Errors carry the operation `session.list`,
|
|
66
|
+
`session.revoke` or `session.revoke-others`.
|
|
67
|
+
|
|
68
|
+
### Version 0.32.1
|
|
69
|
+
|
|
70
|
+
- Fixed: `new Passflow()` no longer reads or creates the device id in constructors; the first
|
|
71
|
+
request does. Constructing the SDK during a server render no longer calls `crypto.randomUUID()`.
|
|
72
|
+
- Fixed: the device id, scopes, invitation token and previous redirect URL keys honour
|
|
73
|
+
`keyStoragePrefix`. A value stored under the old unprefixed key is still used, and moved to the
|
|
74
|
+
prefixed key on first read. With no prefix nothing changes.
|
|
75
|
+
- Fixed: with storage that keeps nothing, one `Passflow` instance sends one device id instead of a
|
|
76
|
+
new one per request. An empty stored scope list is kept as empty.
|
|
77
|
+
|
|
5
78
|
### Version 0.32.0
|
|
6
79
|
|
|
7
80
|
- `passflow.withAuth(fetch, { origins })`, `passflow.attachAuth(axios, { origins })` and
|
|
@@ -83,7 +156,7 @@ Matches the SDK to the server's real two-factor, step-up and sign-out answers.
|
|
|
83
156
|
`sign_in_required: true` first. After the fresh sign-in, the level refusal follows as
|
|
84
157
|
`UpgradeUnsatisfiableError`, so that sign-in cannot help.
|
|
85
158
|
- A cookie or BFF session that stores no ID token makes another app's session undetectable, so this
|
|
86
|
-
app's `logOut()` clears the shared delivery mode
|
|
159
|
+
app's `logOut()` clears the shared delivery mode. It fails safe: the other app is
|
|
87
160
|
signed out, never wrongly signed in.
|
|
88
161
|
|
|
89
162
|
### Version 0.30.1
|