@molecule/app-auth 1.5.2 → 1.5.4
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 +170 -97
- package/dist/browser-storage.d.ts +11 -9
- package/dist/browser-storage.d.ts.map +1 -1
- package/dist/browser-storage.js +11 -9
- package/dist/browser-storage.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +288 -48
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +42 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -11
- package/dist/index.js.map +1 -1
- package/dist/token.d.ts +2 -1
- package/dist/token.d.ts.map +1 -1
- package/dist/token.js +2 -1
- package/dist/token.js.map +1 -1
- package/dist/types.d.ts +113 -32
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -46,9 +46,19 @@
|
|
|
46
46
|
* **`getState().status` is the session state to render, in one value.**
|
|
47
47
|
* `'loading'` (no decision yet) → `'authenticated'` / `'unauthenticated'`, and
|
|
48
48
|
* `'unavailable'` when a stored session exists but the server could not confirm it.
|
|
49
|
+
* **A stored token AND a stored user make the FIRST render `'authenticated'`**:
|
|
50
|
+
* `initialize()` sets that state synchronously, before any request, and every
|
|
51
|
+
* verification settles behind that render. Never hold the first paint on
|
|
52
|
+
* `validateSession()` or a `/me` request of your own — a protected page then pays
|
|
53
|
+
* an API round trip on every navigation (xr-molecule-flash-m177: ~30 full page
|
|
54
|
+
* loads in one pagination spec; its four tests sat at 15.0–15.9 s of a 15 s
|
|
55
|
+
* budget and the grader timed two out). Route guards read this same `status`:
|
|
56
|
+
* wait only while it is `'loading'`.
|
|
49
57
|
* `validateSession()` is the background re-check that produces the last two: call
|
|
50
|
-
* it after the first render — a
|
|
51
|
-
* network failure
|
|
58
|
+
* it after the first render — a 401 or 403 clears the token (`'unauthenticated'`),
|
|
59
|
+
* while a network failure, a 5xx, or a 404 from a wrong `currentUserEndpoint`
|
|
60
|
+
* KEEPS the token and the user (`'unavailable'`, retryable; the 404 error names
|
|
61
|
+
* `currentUserEndpoint`). Do not build a
|
|
52
62
|
* `validating`/`unavailable` flag beside the client: a second module-level state
|
|
53
63
|
* plus its own listener set is a second session store, and it drifts from the
|
|
54
64
|
* client's.
|
|
@@ -62,10 +72,27 @@
|
|
|
62
72
|
* (`validateSession()` clears it) or the user logs out. `autoRefresh: true`
|
|
63
73
|
* against such an API is harmless but pointless — leave it `false`.
|
|
64
74
|
*
|
|
75
|
+
* **Seeding a session from an exchange the app runs itself: `setSession()`.** When an OAuth
|
|
76
|
+
* redirect or the app's own sign-in endpoint has already issued the token and returned the
|
|
77
|
+
* user, `setSession({ accessToken, user })` stores both and flips the client to
|
|
78
|
+
* `authenticated` in one update, so every hook reading the shared client is signed in at once
|
|
79
|
+
* (a form's own sign-in code wrote the token and the user with `setAccessToken`/`setUser`,
|
|
80
|
+
* which change their field only — the UI stayed signed out and nine browser assertions timed
|
|
81
|
+
* out, xr-molecule-flash-m178). `setAccessToken()` and `setUser()` are field setters, not a
|
|
82
|
+
* sign-in: neither sets `authenticated`.
|
|
83
|
+
*
|
|
84
|
+
* **A background verification that returns an unchanged user changes nothing.** When
|
|
85
|
+
* `validateSession()` (or a reload's restore) answers with the same profile data the client
|
|
86
|
+
* already holds, the client keeps the SAME user object and does not notify subscribers — so an
|
|
87
|
+
* effect seeded from `user` does not re-run, and a form it fills keeps what has been typed.
|
|
88
|
+
* Seed such a form once (on its first load), never on every `user` identity.
|
|
89
|
+
*
|
|
65
90
|
* **A token another tool reads at its own key is a CONFIG field, not a mirror.**
|
|
66
91
|
* An e2e suite or host page that expects `localStorage.jwtToken` (the RealWorld
|
|
67
|
-
* specs do) is satisfied by `tokenKey: 'jwtToken'`
|
|
68
|
-
*
|
|
92
|
+
* specs do) is satisfied by `tokenKey: 'jwtToken'` — in a browser the client's
|
|
93
|
+
* storage default is already `createBrowserStorageAdapter()`, so with an explicit
|
|
94
|
+
* `'memory'` store you must also pass
|
|
95
|
+
* `storage: createBrowserStorageAdapter()`. Writing the token into that key from a
|
|
69
96
|
* subscription beside the client is a second store. In React, `useAuth()` from
|
|
70
97
|
* `@molecule/app-react` returns the client's `state` (with `status`), `user` and
|
|
71
98
|
* `isAuthenticated`; the token is `useAuthClient().getAccessToken()`.
|
|
@@ -83,7 +110,11 @@
|
|
|
83
110
|
* - **An API with its own auth envelope keeps this client.** `requestBody` wraps the
|
|
84
111
|
* login/register payload (`(kind, p) => ({ user: p })`), `mapAuthResponse` reads the
|
|
85
112
|
* token and user out of the answer (`(d) => ({ accessToken: d.user.token, user: d.user })`),
|
|
86
|
-
* and `authScheme: 'Token'` sends `Authorization: Token <jwt
|
|
113
|
+
* and `authScheme: 'Token'` sends `Authorization: Token <jwt>`. `mapAuthResponse` is the
|
|
114
|
+
* ONE user-shape adapter: the client applies it to every answer that carries a user (login,
|
|
115
|
+
* register, `validateSession()`, the cookie restore, a token refresh, `updateProfile()`), so
|
|
116
|
+
* the adapted profile survives a reload instead of being replaced by the raw wire user.
|
|
117
|
+
* Both are fields of the
|
|
87
118
|
* `AuthClientConfig` the client is CONSTRUCTED with
|
|
88
119
|
* (`setClient(createJWTAuthClient({ authScheme: 'Token', … }))` in the auth bond), not
|
|
89
120
|
* properties of a client that already exists. Do not hand-write an auth client for a spec
|
|
@@ -161,12 +192,12 @@
|
|
|
161
192
|
* - [ ] The session survives a FULL page reload: after login, hard-reload → you
|
|
162
193
|
* stay signed in (the profile/sign-out UI a signed-in visitor sees is still
|
|
163
194
|
* there), and you are NOT bounced to login. Which route does it is the app's
|
|
164
|
-
* `AuthClientConfig.storage`: the
|
|
165
|
-
*
|
|
166
|
-
* `initialize()` through `currentUserEndpoint`
|
|
167
|
-
*
|
|
168
|
-
* cookie
|
|
169
|
-
* store written beside the client.
|
|
195
|
+
* `AuthClientConfig.storage`: in a browser the client defaults to
|
|
196
|
+
* `createBrowserStorageAdapter()`, which keeps the token there; an httpOnly
|
|
197
|
+
* session cookie is restored by `initialize()` through `currentUserEndpoint`
|
|
198
|
+
* (default `/users/me`). If the app sets `storage: 'memory'` explicitly against
|
|
199
|
+
* an API that sets no cookie, this box cannot be checked, and the fix is the
|
|
200
|
+
* config, not a token store written beside the client.
|
|
170
201
|
* - [ ] Password reset round-trips: `requestPasswordReset({ email })` then
|
|
171
202
|
* `confirmPasswordReset({ token, password })` with the emailed token, after
|
|
172
203
|
* which `login()` with the NEW password succeeds and the OLD password no
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsNG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -46,9 +46,19 @@
|
|
|
46
46
|
* **`getState().status` is the session state to render, in one value.**
|
|
47
47
|
* `'loading'` (no decision yet) → `'authenticated'` / `'unauthenticated'`, and
|
|
48
48
|
* `'unavailable'` when a stored session exists but the server could not confirm it.
|
|
49
|
+
* **A stored token AND a stored user make the FIRST render `'authenticated'`**:
|
|
50
|
+
* `initialize()` sets that state synchronously, before any request, and every
|
|
51
|
+
* verification settles behind that render. Never hold the first paint on
|
|
52
|
+
* `validateSession()` or a `/me` request of your own — a protected page then pays
|
|
53
|
+
* an API round trip on every navigation (xr-molecule-flash-m177: ~30 full page
|
|
54
|
+
* loads in one pagination spec; its four tests sat at 15.0–15.9 s of a 15 s
|
|
55
|
+
* budget and the grader timed two out). Route guards read this same `status`:
|
|
56
|
+
* wait only while it is `'loading'`.
|
|
49
57
|
* `validateSession()` is the background re-check that produces the last two: call
|
|
50
|
-
* it after the first render — a
|
|
51
|
-
* network failure
|
|
58
|
+
* it after the first render — a 401 or 403 clears the token (`'unauthenticated'`),
|
|
59
|
+
* while a network failure, a 5xx, or a 404 from a wrong `currentUserEndpoint`
|
|
60
|
+
* KEEPS the token and the user (`'unavailable'`, retryable; the 404 error names
|
|
61
|
+
* `currentUserEndpoint`). Do not build a
|
|
52
62
|
* `validating`/`unavailable` flag beside the client: a second module-level state
|
|
53
63
|
* plus its own listener set is a second session store, and it drifts from the
|
|
54
64
|
* client's.
|
|
@@ -62,10 +72,27 @@
|
|
|
62
72
|
* (`validateSession()` clears it) or the user logs out. `autoRefresh: true`
|
|
63
73
|
* against such an API is harmless but pointless — leave it `false`.
|
|
64
74
|
*
|
|
75
|
+
* **Seeding a session from an exchange the app runs itself: `setSession()`.** When an OAuth
|
|
76
|
+
* redirect or the app's own sign-in endpoint has already issued the token and returned the
|
|
77
|
+
* user, `setSession({ accessToken, user })` stores both and flips the client to
|
|
78
|
+
* `authenticated` in one update, so every hook reading the shared client is signed in at once
|
|
79
|
+
* (a form's own sign-in code wrote the token and the user with `setAccessToken`/`setUser`,
|
|
80
|
+
* which change their field only — the UI stayed signed out and nine browser assertions timed
|
|
81
|
+
* out, xr-molecule-flash-m178). `setAccessToken()` and `setUser()` are field setters, not a
|
|
82
|
+
* sign-in: neither sets `authenticated`.
|
|
83
|
+
*
|
|
84
|
+
* **A background verification that returns an unchanged user changes nothing.** When
|
|
85
|
+
* `validateSession()` (or a reload's restore) answers with the same profile data the client
|
|
86
|
+
* already holds, the client keeps the SAME user object and does not notify subscribers — so an
|
|
87
|
+
* effect seeded from `user` does not re-run, and a form it fills keeps what has been typed.
|
|
88
|
+
* Seed such a form once (on its first load), never on every `user` identity.
|
|
89
|
+
*
|
|
65
90
|
* **A token another tool reads at its own key is a CONFIG field, not a mirror.**
|
|
66
91
|
* An e2e suite or host page that expects `localStorage.jwtToken` (the RealWorld
|
|
67
|
-
* specs do) is satisfied by `tokenKey: 'jwtToken'`
|
|
68
|
-
*
|
|
92
|
+
* specs do) is satisfied by `tokenKey: 'jwtToken'` — in a browser the client's
|
|
93
|
+
* storage default is already `createBrowserStorageAdapter()`, so with an explicit
|
|
94
|
+
* `'memory'` store you must also pass
|
|
95
|
+
* `storage: createBrowserStorageAdapter()`. Writing the token into that key from a
|
|
69
96
|
* subscription beside the client is a second store. In React, `useAuth()` from
|
|
70
97
|
* `@molecule/app-react` returns the client's `state` (with `status`), `user` and
|
|
71
98
|
* `isAuthenticated`; the token is `useAuthClient().getAccessToken()`.
|
|
@@ -83,7 +110,11 @@
|
|
|
83
110
|
* - **An API with its own auth envelope keeps this client.** `requestBody` wraps the
|
|
84
111
|
* login/register payload (`(kind, p) => ({ user: p })`), `mapAuthResponse` reads the
|
|
85
112
|
* token and user out of the answer (`(d) => ({ accessToken: d.user.token, user: d.user })`),
|
|
86
|
-
* and `authScheme: 'Token'` sends `Authorization: Token <jwt
|
|
113
|
+
* and `authScheme: 'Token'` sends `Authorization: Token <jwt>`. `mapAuthResponse` is the
|
|
114
|
+
* ONE user-shape adapter: the client applies it to every answer that carries a user (login,
|
|
115
|
+
* register, `validateSession()`, the cookie restore, a token refresh, `updateProfile()`), so
|
|
116
|
+
* the adapted profile survives a reload instead of being replaced by the raw wire user.
|
|
117
|
+
* Both are fields of the
|
|
87
118
|
* `AuthClientConfig` the client is CONSTRUCTED with
|
|
88
119
|
* (`setClient(createJWTAuthClient({ authScheme: 'Token', … }))` in the auth bond), not
|
|
89
120
|
* properties of a client that already exists. Do not hand-write an auth client for a spec
|
|
@@ -161,12 +192,12 @@
|
|
|
161
192
|
* - [ ] The session survives a FULL page reload: after login, hard-reload → you
|
|
162
193
|
* stay signed in (the profile/sign-out UI a signed-in visitor sees is still
|
|
163
194
|
* there), and you are NOT bounced to login. Which route does it is the app's
|
|
164
|
-
* `AuthClientConfig.storage`: the
|
|
165
|
-
*
|
|
166
|
-
* `initialize()` through `currentUserEndpoint`
|
|
167
|
-
*
|
|
168
|
-
* cookie
|
|
169
|
-
* store written beside the client.
|
|
195
|
+
* `AuthClientConfig.storage`: in a browser the client defaults to
|
|
196
|
+
* `createBrowserStorageAdapter()`, which keeps the token there; an httpOnly
|
|
197
|
+
* session cookie is restored by `initialize()` through `currentUserEndpoint`
|
|
198
|
+
* (default `/users/me`). If the app sets `storage: 'memory'` explicitly against
|
|
199
|
+
* an API that sets no cookie, this box cannot be checked, and the fix is the
|
|
200
|
+
* config, not a token store written beside the client.
|
|
170
201
|
* - [ ] Password reset round-trips: `requestPasswordReset({ email })` then
|
|
171
202
|
* `confirmPasswordReset({ token, password })` with the emailed token, after
|
|
172
203
|
* which `login()` with the NEW password succeeds and the OLD password no
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsNG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
package/dist/token.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ import type { StorageAdapter, TokenStorage } from './types.js';
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```typescript
|
|
22
|
-
* // In-memory storage (the client's default
|
|
22
|
+
* // In-memory storage (this factory's default; the client's browser default is
|
|
23
|
+
* // createBrowserStorageAdapter — pass `'memory'` there for a cookie session)
|
|
23
24
|
* const storage = createTokenStorage('memory')
|
|
24
25
|
*
|
|
25
26
|
* // The browser's persistent storage — a reload keeps the session
|
package/dist/token.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAe,MAAM,YAAY,CAAA;AAE3E
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAe,MAAM,YAAY,CAAA;AAE3E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAS,QAAQ,GAAG,cAAyB,EAC7C,SAAQ,MAAyB,EACjC,WAAW,MAAM,KAChB,YAsEF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,MAAM,KAAG,CAAC,GAAG,IAWzE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,EAAE,gBAAe,MAAU,KAAG,OAMzE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAI3D,CAAA"}
|
package/dist/token.js
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
21
|
-
* // In-memory storage (the client's default
|
|
21
|
+
* // In-memory storage (this factory's default; the client's browser default is
|
|
22
|
+
* // createBrowserStorageAdapter — pass `'memory'` there for a cookie session)
|
|
22
23
|
* const storage = createTokenStorage('memory')
|
|
23
24
|
*
|
|
24
25
|
* // The browser's persistent storage — a reload keeps the session
|
package/dist/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,UAAqC,QAAQ,EAC7C,SAAiB,gBAAgB,EACjC,QAAiB,EACH,EAAE;IAChB,MAAM,WAAW,GAAkC,EAAE,CAAA;IAErD,4BAA4B;IAC5B,IAAI,OAAO,GAA0B,IAAI,CAAA;IACzC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,GAAG,OAAO,CAAA;IACnB,CAAC;IAED,MAAM,cAAc,GAAG,GAAW,EAAE,CAAC,QAAQ,IAAI,GAAG,MAAM,aAAa,CAAA;IAEvE,MAAM,GAAG,GAAG,CAAC,GAAW,EAAiB,EAAE;QACzC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;QACtC,CAAC;QACD,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,IAAI,CAAA;IACjC,CAAC,CAAA;IAED,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,KAAoB,EAAQ,EAA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E;IAClF,MAAM,OAAO,GAAG,QAAQ,CAAmB,KAAK,CAAC,CAAA;IACjD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IACzC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAA;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,GAAG,IAAI,CAAA;IAC7C,OAAO,GAAG,IAAI,SAAS,CAAA;AACzB,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAiB,EAAE;IACjE,MAAM,OAAO,GAAG,QAAQ,CAAmB,KAAK,CAAC,CAAA;IACjD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG;QAAE,OAAO,IAAI,CAAA;IACzC,OAAO,OAAO,CAAC,GAAG,GAAG,IAAI,CAAA;AAC3B,CAAC,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -210,6 +210,21 @@ export type AuthEvent = {
|
|
|
210
210
|
* Callback invoked when an authentication event occurs (login, logout, etc.).
|
|
211
211
|
*/
|
|
212
212
|
export type AuthEventListener = (event: AuthEvent) => void;
|
|
213
|
+
/**
|
|
214
|
+
* A complete session an exchange outside the client has already established — an OAuth
|
|
215
|
+
* code→token redirect, or the app's own sign-in endpoint. {@link AuthClient.setSession} adopts
|
|
216
|
+
* it in one update: the token and the user are stored and the client becomes `authenticated`.
|
|
217
|
+
*
|
|
218
|
+
* @template T - The user profile the API returns.
|
|
219
|
+
*/
|
|
220
|
+
export interface AuthSessionSeed<T = UserProfile> {
|
|
221
|
+
/** The access token the exchange issued. */
|
|
222
|
+
accessToken: string;
|
|
223
|
+
/** The profile that token belongs to, as the API returned it. */
|
|
224
|
+
user: T;
|
|
225
|
+
/** A refresh token, when the exchange issued one; omitted leaves the stored one untouched. */
|
|
226
|
+
refreshToken?: string | null;
|
|
227
|
+
}
|
|
213
228
|
/**
|
|
214
229
|
* Auth client interface that all auth bond packages must implement.
|
|
215
230
|
* Provides login/logout/register flows, token management, profile
|
|
@@ -237,6 +252,11 @@ export interface AuthClient<T = UserProfile, TRegister extends Record<string, un
|
|
|
237
252
|
* hitting the network. Intended for local refreshes after a per-app
|
|
238
253
|
* mutation (e.g., the user just PATCHed their own profile and the
|
|
239
254
|
* server returned the canonical row). Does NOT change tokens.
|
|
255
|
+
*
|
|
256
|
+
* This does not sign the client in: `authenticated` and `status` are
|
|
257
|
+
* unchanged, so an anonymous client stays anonymous. Use
|
|
258
|
+
* {@link login} / {@link register} for a credential exchange, or
|
|
259
|
+
* {@link setSession} when the token was issued outside the client.
|
|
240
260
|
*/
|
|
241
261
|
setUser(user: T | null): void;
|
|
242
262
|
/**
|
|
@@ -244,13 +264,32 @@ export interface AuthClient<T = UserProfile, TRegister extends Record<string, un
|
|
|
244
264
|
*/
|
|
245
265
|
getAccessToken(): string | null;
|
|
246
266
|
/**
|
|
247
|
-
* Stores the access token in the configured token storage adapter (in
|
|
248
|
-
*
|
|
249
|
-
* the
|
|
250
|
-
*
|
|
251
|
-
*
|
|
267
|
+
* Stores the access token in the configured token storage adapter (in a
|
|
268
|
+
* browser, Web Storage; `'memory'` where no browser store exists). Use this
|
|
269
|
+
* to seed the token after an out-of-band exchange (e.g. the OAuth
|
|
270
|
+
* code→token redirect) instead of writing to `localStorage` directly,
|
|
271
|
+
* which would violate the storage contract and make a stored bearer token
|
|
272
|
+
* JS-readable (XSS-exfiltratable). Pass `null` to clear it.
|
|
273
|
+
*
|
|
274
|
+
* This changes token storage only; it does not sign the client in
|
|
275
|
+
* (`authenticated` and `status` are unchanged). Use {@link login} /
|
|
276
|
+
* {@link register} for a credential exchange, or call {@link setSession}
|
|
277
|
+
* with the token and the user to establish an already-issued session.
|
|
252
278
|
*/
|
|
253
279
|
setAccessToken(token: string | null): void;
|
|
280
|
+
/**
|
|
281
|
+
* Adopts a session an out-of-band exchange already established: stores the
|
|
282
|
+
* access token (and the refresh token when given), caches the user, and
|
|
283
|
+
* sets the COMPLETE state — `initialized`, `authenticated`, `status:
|
|
284
|
+
* 'authenticated'`, no error — in one update, with one subscriber
|
|
285
|
+
* notification. Every hook reading the shared client sees the user as
|
|
286
|
+
* signed in immediately.
|
|
287
|
+
*
|
|
288
|
+
* This is the way to seed an OAuth/custom sign-in. Calling
|
|
289
|
+
* {@link setAccessToken} and {@link setUser} instead does NOT sign the
|
|
290
|
+
* client in.
|
|
291
|
+
*/
|
|
292
|
+
setSession(session: AuthSessionSeed<T>): void;
|
|
254
293
|
/**
|
|
255
294
|
* Gets the refresh token.
|
|
256
295
|
*/
|
|
@@ -290,6 +329,19 @@ export interface AuthClient<T = UserProfile, TRegister extends Record<string, un
|
|
|
290
329
|
changePassword(oldPassword: string, newPassword: string): Promise<void>;
|
|
291
330
|
/**
|
|
292
331
|
* Initializes auth state (e.g., from stored tokens).
|
|
332
|
+
*
|
|
333
|
+
* With a stored token AND a stored user it marks the session `'authenticated'`
|
|
334
|
+
* SYNCHRONOUSLY — before its first `await` — so the first render is the
|
|
335
|
+
* signed-in UI and no page waits on a verification round trip. Any check
|
|
336
|
+
* (a refresh, the cookie-restore probe) settles behind that render, and only an
|
|
337
|
+
* explicit 401/403 ends the session; a network/5xx/404 failure keeps it and
|
|
338
|
+
* reports `'unavailable'`. With no stored user the client stays `'loading'`
|
|
339
|
+
* until the cookie restore decides.
|
|
340
|
+
*
|
|
341
|
+
* Do not put this call (or a `/me` request of your own) in front of the first
|
|
342
|
+
* render, and do not render a loading screen over a session it just restored:
|
|
343
|
+
* `whenRestored()` already resolves as soon as the restore has settled, and the
|
|
344
|
+
* HTTP gate built on it holds requests for exactly that window.
|
|
293
345
|
*/
|
|
294
346
|
initialize(): Promise<void>;
|
|
295
347
|
/**
|
|
@@ -300,11 +352,13 @@ export interface AuthClient<T = UserProfile, TRegister extends Record<string, un
|
|
|
300
352
|
*
|
|
301
353
|
* - The server confirms the user: the session is refreshed and {@link AuthState.status}
|
|
302
354
|
* stays `'authenticated'`.
|
|
303
|
-
* - The server answers
|
|
304
|
-
* the status becomes `'unauthenticated'`.
|
|
305
|
-
* - The server cannot
|
|
306
|
-
*
|
|
307
|
-
* user
|
|
355
|
+
* - The server answers 401 or 403: the token is dead — the stored session is
|
|
356
|
+
* cleared and the status becomes `'unauthenticated'`.
|
|
357
|
+
* - The server cannot confirm the session — a network failure, a 5xx, or a 404
|
|
358
|
+
* from a misconfigured {@link AuthClientConfig.currentUserEndpoint}: the
|
|
359
|
+
* session (token AND user) is KEPT and the status becomes `'unavailable'`, so
|
|
360
|
+
* the app can retry instead of signing the user out over a bad connection or a
|
|
361
|
+
* route that does not exist. The 404 error names `currentUserEndpoint`.
|
|
308
362
|
*
|
|
309
363
|
* Do not hand-write this beside the client: a parallel token/user store for a
|
|
310
364
|
* "validating"/"unavailable" flag is the race this method removes.
|
|
@@ -393,11 +447,17 @@ export interface AuthClientConfig {
|
|
|
393
447
|
*/
|
|
394
448
|
profileEndpoint?: string;
|
|
395
449
|
/**
|
|
396
|
-
*
|
|
397
|
-
* `initialize()`
|
|
398
|
-
* load when the token did not survive the reload itself — i.e. when
|
|
399
|
-
* `'memory'` and the API sets an httpOnly session cookie
|
|
400
|
-
*
|
|
450
|
+
* The API route that returns the signed-in user (default `/users/me`). Called
|
|
451
|
+
* with credentials by `initialize()` to re-establish the session after a full
|
|
452
|
+
* page load when the token did not survive the reload itself — i.e. when
|
|
453
|
+
* `storage` is `'memory'` and the API sets an httpOnly session cookie — and by
|
|
454
|
+
* {@link AuthClient.validateSession} on every reload to confirm a stored token
|
|
455
|
+
* is still valid. Must return the user (as `user` or `props`).
|
|
456
|
+
*
|
|
457
|
+
* Set it whenever the app serves its own current-user route: a wrong value
|
|
458
|
+
* answers 404, which `validateSession` reports as `'unavailable'` and keeps the
|
|
459
|
+
* stored token instead of signing the user out — but the session then stays
|
|
460
|
+
* unconfirmed.
|
|
401
461
|
*/
|
|
402
462
|
currentUserEndpoint?: string;
|
|
403
463
|
/**
|
|
@@ -413,6 +473,12 @@ export interface AuthClientConfig {
|
|
|
413
473
|
* second library, a host page — instead of mirroring the token into
|
|
414
474
|
* `localStorage` beside the client. The refresh token and the cached user keep
|
|
415
475
|
* the prefix.
|
|
476
|
+
*
|
|
477
|
+
* In a browser the client's storage default is {@link createBrowserStorageAdapter},
|
|
478
|
+
* so `tokenKey` alone writes the token to exactly that key and a reload keeps
|
|
479
|
+
* the session. An EXPLICIT `storage: 'memory'` beside it warns at construction:
|
|
480
|
+
* the value then lives in a process-local Map nothing outside this client can
|
|
481
|
+
* read, and a reload signs the user out.
|
|
416
482
|
*/
|
|
417
483
|
tokenKey?: string;
|
|
418
484
|
/**
|
|
@@ -449,9 +515,23 @@ export interface AuthClientConfig {
|
|
|
449
515
|
*/
|
|
450
516
|
requestBody?: (kind: 'login' | 'register', payload: Record<string, unknown>) => unknown;
|
|
451
517
|
/**
|
|
452
|
-
* Turn
|
|
518
|
+
* Turn an answer that carries a user into the client's
|
|
453
519
|
* `{ accessToken, refreshToken?, user }` (default: the answer as given).
|
|
454
520
|
* RealWorld, for example: `(data) => ({ accessToken: data.user.token, user: data.user })`.
|
|
521
|
+
*
|
|
522
|
+
* It is the ONE user-shape adapter, and the client applies it on EVERY path
|
|
523
|
+
* that adopts a user from an API answer — `login()`, `register()`,
|
|
524
|
+
* `validateSession()`, the cookie restore `initialize()`/`refresh()` run, the
|
|
525
|
+
* token-refresh answer, and `updateProfile()`. Those answers carry the raw wire
|
|
526
|
+
* user (a current-user route typically answers a bare `{ user }`), so applying
|
|
527
|
+
* the same mapping is what keeps the adapted profile after a reload instead of
|
|
528
|
+
* replacing it with the unadapted one (xr-molecule-flash-m184). A mapper that
|
|
529
|
+
* cannot read a given answer (it throws, or returns no `user`) leaves that
|
|
530
|
+
* answer's user as it came.
|
|
531
|
+
*
|
|
532
|
+
* It is NOT applied to `setSession()` or `setUser()`: those receive a profile
|
|
533
|
+
* the caller already built in this client's shape, not a wire answer.
|
|
534
|
+
*
|
|
455
535
|
* @param data - The parsed response body.
|
|
456
536
|
* @returns The auth result.
|
|
457
537
|
*/
|
|
@@ -460,19 +540,21 @@ export interface AuthClientConfig {
|
|
|
460
540
|
* Where the access/refresh token and the cached user are kept — the field that
|
|
461
541
|
* decides whether a page reload keeps the user signed in.
|
|
462
542
|
*
|
|
463
|
-
* **In
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
543
|
+
* **In a browser the default is `createBrowserStorageAdapter()` (Web Storage)**,
|
|
544
|
+
* so a reload keeps the session with no wiring of its own; outside a browser
|
|
545
|
+
* (SSR, a Node test) the default is `'memory'`. Pass `'memory'` EXPLICITLY when
|
|
546
|
+
* the API sets an httpOnly session cookie and you do not want a script-readable
|
|
547
|
+
* copy: `'memory'` is a process-local store, and `initialize()` then restores
|
|
548
|
+
* through {@link AuthClientConfig.currentUserEndpoint} — the strongest
|
|
549
|
+
* configuration, because no script can read the cookie.
|
|
467
550
|
*
|
|
468
|
-
* **An app whose external contract requires
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
* refresh token and the cached user keep `storagePrefix`.
|
|
551
|
+
* **An app whose external contract requires the token at a specific key** — a
|
|
552
|
+
* supplied e2e suite (the RealWorld specs read `localStorage.jwtToken` in
|
|
553
|
+
* `SELECTORS.md`), a host page, a second library — sets `tokenKey: 'jwtToken'`;
|
|
554
|
+
* in a browser that is enough, because the default store is Web Storage. The
|
|
555
|
+
* session (token AND user) is then restored synchronously in `initialize()` —
|
|
556
|
+
* with no store of your own. `tokenKey` places the access token at that exact
|
|
557
|
+
* key; the refresh token and the cached user keep `storagePrefix`.
|
|
476
558
|
*
|
|
477
559
|
* A bearer token in Web Storage is readable by any script on the origin, so an
|
|
478
560
|
* XSS can steal it; see {@link createBrowserStorageAdapter}'s `@remarks` for the
|
|
@@ -490,14 +572,13 @@ export interface AuthClientConfig {
|
|
|
490
572
|
* ```typescript
|
|
491
573
|
* import { createBrowserStorageAdapter } from '@molecule/app-auth'
|
|
492
574
|
*
|
|
493
|
-
* // A suite/host page reads the token at its own key
|
|
575
|
+
* // A suite/host page reads the token at its own key (the browser default
|
|
576
|
+
* // already stores it; `storage` is shown for an explicit choice):
|
|
494
577
|
* storage: createBrowserStorageAdapter()
|
|
495
578
|
* tokenKey: 'jwtToken'
|
|
496
|
-
* // A reload keeps the session at this client's own keys:
|
|
497
|
-
* storage: createBrowserStorageAdapter()
|
|
498
579
|
* // Only this tab's lifetime, at a narrower exposure than localStorage:
|
|
499
580
|
* storage: createBrowserStorageAdapter({ kind: 'session' })
|
|
500
|
-
* // An httpOnly cookie session
|
|
581
|
+
* // An httpOnly cookie session — keep the bearer out of script-reachable storage:
|
|
501
582
|
* storage: 'memory'
|
|
502
583
|
* ```
|
|
503
584
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAA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