@withone/connect 0.19.0 → 0.19.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
@@ -57,7 +57,7 @@ The button, the routes and the calls are the same either way. Only what your ser
57
57
  | Expires | Nothing | The access token per your app's Token lifetime; the refresh token after 30 days |
58
58
  | You also run | Nothing | A daily refresh job |
59
59
  | When a user revokes | The next call throws `reconnect_required` | The next refresh throws `refresh_failed` |
60
- | A call outside the grant | `403` with `blockedByGrant: true` | `403` (`blockedByGrant` stays `false`) |
60
+ | A call outside the grant | `403` with `blockedByGrant: true` | The same |
61
61
  | Pick it when | You are starting out | You need the bearer token itself, or your app already stores tokens |
62
62
 
63
63
  The mode is the credential you pass to `createOneConnect`: `connectKey` and `userStore` for key mode, `tokenStore` for token mode. Sections 1 to 6 use key mode; [section 7](#7--token-mode) shows what changes for token mode.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/connect",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "One Connect for your app: the button your users press, the two backend routes as one import, and a server client that calls One with the grant. Users keep their connections in One; your app holds only what they granted.",
5
5
  "files": [
6
6
  "dist",
@@ -30,7 +30,7 @@ the server keeps differs.
30
30
  | Server keeps | one connect key for the app, one id per user | an access and a refresh token per user |
31
31
  | Expires | nothing | yes; the app runs a daily refresh job |
32
32
  | User revoked | next call throws `reconnect_required` | next refresh throws `refresh_failed` |
33
- | Call outside the grant | `403`, `blockedByGrant: true` | `403`, `blockedByGrant` stays `false` |
33
+ | Call outside the grant | `403`, `blockedByGrant: true` | the same |
34
34
 
35
35
  Use **key mode** unless the human asks for token mode, the app needs the
36
36
  bearer token itself, or the app already passes a `tokenStore`. Do not switch
@@ -396,8 +396,8 @@ const accessToken = await oneConnect.getAccessToken(userId); // when the app nee
396
396
  - When the user revokes access, the next refresh throws `refresh_failed`
397
397
  (not `reconnect_required`) and the tokens are cleared. Ask them to connect
398
398
  again.
399
- - `blockedByGrant` stays `false` in token mode; treat any `403` as outside
400
- the grant.
399
+ - A call outside the grant comes back as in key mode: `403`,
400
+ `blockedByGrant: true`, `refusal: "grant"`.
401
401
 
402
402
  Tokens expire, and two things keep them fresh. Only the first is automatic:
403
403