@molecule/app-auth 1.5.1 → 1.5.3

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
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-10-18T07:07:01.723Z
6
+ Generated: 2026-10-18T11:15:30.441Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-auth
@@ -44,13 +44,22 @@ over the network it does not, so the bug appears only on the deployed URL.
44
44
  Gate the fetch on the auth state being settled (`state.initialized`), or let
45
45
  the HTTP client do it: `@molecule/app-bonds-default-react` registers
46
46
  `whenRestored()` as the gate so every request waits for the restore.
47
+ Waiting for the restore does NOT attach its token: a separately created HTTP
48
+ client needs
49
+ `createDefaultHttpClientWithAuthBearer({ baseURL, getToken: () => authClient.getAccessToken(), authScheme })`
50
+ from `@molecule/app-bonds-default-react` plus
51
+ `setAuthGate(() => authClient.whenRestored())` from `@molecule/app-http` — or
52
+ the auth client built with `createDefaultAuthClientWithHttpSync`, which
53
+ mirrors the token into the bonded client.
47
54
 
48
55
  **`getState().status` is the session state to render, in one value.**
49
56
  `'loading'` (no decision yet) → `'authenticated'` / `'unauthenticated'`, and
50
57
  `'unavailable'` when a stored session exists but the server could not confirm it.
51
58
  `validateSession()` is the background re-check that produces the last two: call
52
- it after the first render — a 4xx clears the token (`'unauthenticated'`), a
53
- network failure or 5xx KEEPS it (`'unavailable'`, retryable). Do not build a
59
+ it after the first render — a 401 or 403 clears the token (`'unauthenticated'`),
60
+ while a network failure, a 5xx, or a 404 from a wrong `currentUserEndpoint`
61
+ KEEPS the token and the user (`'unavailable'`, retryable; the 404 error names
62
+ `currentUserEndpoint`). Do not build a
54
63
  `validating`/`unavailable` flag beside the client: a second module-level state
55
64
  plus its own listener set is a second session store, and it drifts from the
56
65
  client's.
@@ -66,8 +75,10 @@ against such an API is harmless but pointless — leave it `false`.
66
75
 
67
76
  **A token another tool reads at its own key is a CONFIG field, not a mirror.**
68
77
  An e2e suite or host page that expects `localStorage.jwtToken` (the RealWorld
69
- specs do) is satisfied by `tokenKey: 'jwtToken'` with
70
- `storage: createBrowserStorageAdapter()`; writing the token into that key from a
78
+ specs do) is satisfied by `tokenKey: 'jwtToken'` — in a browser the client's
79
+ storage default is already `createBrowserStorageAdapter()`, so with an explicit
80
+ `'memory'` store you must also pass
81
+ `storage: createBrowserStorageAdapter()`. Writing the token into that key from a
71
82
  subscription beside the client is a second store. In React, `useAuth()` from
72
83
  `@molecule/app-react` returns the client's `state` (with `status`), `user` and
73
84
  `isAuthenticated`; the token is `useAuthClient().getAccessToken()`.
@@ -441,11 +452,13 @@ interface AuthClient<
441
452
  *
442
453
  * - The server confirms the user: the session is refreshed and {@link AuthState.status}
443
454
  * stays `'authenticated'`.
444
- * - The server answers 4xx: the token is dead — the stored session is cleared and
445
- * the status becomes `'unauthenticated'`.
446
- * - The server cannot answer (network failure or 5xx): the session is KEPT and the
447
- * status becomes `'unavailable'`, so the app can retry instead of signing the
448
- * user out over a bad connection.
455
+ * - The server answers 401 or 403: the token is dead — the stored session is
456
+ * cleared and the status becomes `'unauthenticated'`.
457
+ * - The server cannot confirm the session — a network failure, a 5xx, or a 404
458
+ * from a misconfigured {@link AuthClientConfig.currentUserEndpoint}: the
459
+ * session (token AND user) is KEPT and the status becomes `'unavailable'`, so
460
+ * the app can retry instead of signing the user out over a bad connection or a
461
+ * route that does not exist. The 404 error names `currentUserEndpoint`.
449
462
  *
450
463
  * Do not hand-write this beside the client: a parallel token/user store for a
451
464
  * "validating"/"unavailable" flag is the race this method removes.
@@ -554,11 +567,17 @@ interface AuthClientConfig {
554
567
  profileEndpoint?: string
555
568
 
556
569
  /**
557
- * Current-user endpoint for session restore (default `/users/me`). Called by
558
- * `initialize()` with credentials to re-establish the session after a full page
559
- * load when the token did not survive the reload itself — i.e. when `storage` is
560
- * `'memory'` and the API sets an httpOnly session cookie. Must return the user
561
- * (as `user` or `props`).
570
+ * The API route that returns the signed-in user (default `/users/me`). Called
571
+ * with credentials by `initialize()` to re-establish the session after a full
572
+ * page load when the token did not survive the reload itself — i.e. when
573
+ * `storage` is `'memory'` and the API sets an httpOnly session cookie — and by
574
+ * {@link AuthClient.validateSession} on every reload to confirm a stored token
575
+ * is still valid. Must return the user (as `user` or `props`).
576
+ *
577
+ * Set it whenever the app serves its own current-user route: a wrong value
578
+ * answers 404, which `validateSession` reports as `'unavailable'` and keeps the
579
+ * stored token instead of signing the user out — but the session then stays
580
+ * unconfirmed.
562
581
  */
563
582
  currentUserEndpoint?: string
564
583
 
@@ -576,6 +595,12 @@ interface AuthClientConfig {
576
595
  * second library, a host page — instead of mirroring the token into
577
596
  * `localStorage` beside the client. The refresh token and the cached user keep
578
597
  * the prefix.
598
+ *
599
+ * In a browser the client's storage default is {@link createBrowserStorageAdapter},
600
+ * so `tokenKey` alone writes the token to exactly that key and a reload keeps
601
+ * the session. An EXPLICIT `storage: 'memory'` beside it warns at construction:
602
+ * the value then lives in a process-local Map nothing outside this client can
603
+ * read, and a reload signs the user out.
579
604
  */
580
605
  tokenKey?: string
581
606
 
@@ -627,19 +652,21 @@ interface AuthClientConfig {
627
652
  * Where the access/refresh token and the cached user are kept — the field that
628
653
  * decides whether a page reload keeps the user signed in.
629
654
  *
630
- * **In-memory is the secure default.** `'memory'` is a process-local store, lost
631
- * on reload. It is correct when the API sets an httpOnly session cookie, which
632
- * `initialize()` then restores through {@link AuthClientConfig.currentUserEndpoint}
633
- * — the strongest configuration, because no script can read the cookie.
655
+ * **In a browser the default is `createBrowserStorageAdapter()` (Web Storage)**,
656
+ * so a reload keeps the session with no wiring of its own; outside a browser
657
+ * (SSR, a Node test) the default is `'memory'`. Pass `'memory'` EXPLICITLY when
658
+ * the API sets an httpOnly session cookie and you do not want a script-readable
659
+ * copy: `'memory'` is a process-local store, and `initialize()` then restores
660
+ * through {@link AuthClientConfig.currentUserEndpoint} — the strongest
661
+ * configuration, because no script can read the cookie.
634
662
  *
635
- * **An app whose external contract requires a token in storage opts in
636
- * EXPLICITLY, with these two fields together.** A supplied e2e suite (the
637
- * RealWorld specs read `localStorage.jwtToken` in `SELECTORS.md`), a host page
638
- * or a second library can require the token at its own key: then set
639
- * `storage: createBrowserStorageAdapter()` and `tokenKey: 'jwtToken'`, and the
640
- * session (token AND user) is restored synchronously in `initialize()` — with no
641
- * store of your own. `tokenKey` places the access token at that exact key; the
642
- * refresh token and the cached user keep `storagePrefix`.
663
+ * **An app whose external contract requires the token at a specific key** — a
664
+ * supplied e2e suite (the RealWorld specs read `localStorage.jwtToken` in
665
+ * `SELECTORS.md`), a host page, a second library — sets `tokenKey: 'jwtToken'`;
666
+ * in a browser that is enough, because the default store is Web Storage. The
667
+ * session (token AND user) is then restored synchronously in `initialize()` —
668
+ * with no store of your own. `tokenKey` places the access token at that exact
669
+ * key; the refresh token and the cached user keep `storagePrefix`.
643
670
  *
644
671
  * A bearer token in Web Storage is readable by any script on the origin, so an
645
672
  * XSS can steal it; see {@link createBrowserStorageAdapter}'s `@remarks` for the
@@ -657,14 +684,13 @@ interface AuthClientConfig {
657
684
  * ```typescript
658
685
  * import { createBrowserStorageAdapter } from '@molecule/app-auth'
659
686
  *
660
- * // A suite/host page reads the token at its own key — the opt-in:
687
+ * // A suite/host page reads the token at its own key (the browser default
688
+ * // already stores it; `storage` is shown for an explicit choice):
661
689
  * storage: createBrowserStorageAdapter()
662
690
  * tokenKey: 'jwtToken'
663
- * // A reload keeps the session at this client's own keys:
664
- * storage: createBrowserStorageAdapter()
665
691
  * // Only this tab's lifetime, at a narrower exposure than localStorage:
666
692
  * storage: createBrowserStorageAdapter({ kind: 'session' })
667
- * // An httpOnly cookie session instead — memory only, the stronger route:
693
+ * // An httpOnly cookie session — keep the bearer out of script-reachable storage:
668
694
  * storage: 'memory'
669
695
  * ```
670
696
  */
@@ -706,23 +732,7 @@ interface AuthClientConfig {
706
732
  /**
707
733
  * Password reset confirmation endpoint.
708
734
  */
709
- resetPasswordEndpoint?: string
710
-
711
- /**
712
- * Change password endpoint.
713
- */
714
- changePasswordEndpoint?: string
715
-
716
- /**
717
- * Available OAuth providers (e.g., ['github', 'google', 'gitlab']).
718
- */
719
- oauthProviders?: string[]
720
-
721
- /**
722
- * OAuth endpoint path (default: '/oauth').
723
- */
724
- oauthEndpoint?: string
725
- }
735
+ // … truncated — the full declaration is in node_modules/@molecule/app-auth/dist/types.d.ts
726
736
  ````
727
737
 
728
738
  #### `TokenStorage`
@@ -850,10 +860,11 @@ token as a background request — never in front of the first render. A page tha
850
860
  own `/me` call pays a round trip on EVERY navigation (xr-molecule-flash-m122: a 1–5 s restore
851
861
  window, eight `waitForURL` timeouts).
852
862
 
853
- Pass it as `AuthClientConfig.storage` to keep the session across a page reload:
854
- the client's default (`'memory'`) is lost on reload, and re-establishing the
855
- session then needs a credential that survived — this adapter, or an httpOnly
856
- session cookie the API sets (see the security note below).
863
+ In a browser this IS the auth client's default `AuthClientConfig.storage`, so a scaffolded
864
+ app keeps its session across a page reload with no extra wiring. Outside a browser (SSR, a Node
865
+ test) the client defaults to `'memory'` instead, because there is no Web Storage to use. Pass
866
+ `'memory'` explicitly to keep the bearer token out of script-reachable storage when the API sets
867
+ an httpOnly session cookie (see the security note below).
857
868
 
858
869
  ```ts
859
870
  import { createJWTAuthClient, createBrowserStorageAdapter } from '@molecule/app-auth'
@@ -864,18 +875,18 @@ const authClient = createJWTAuthClient({
864
875
  })
865
876
  ```
866
877
 
867
- The scaffold's `authConfig` already passes it, so a scaffolded app survives a
878
+ The browser client already defaults to it, so a scaffolded app survives a
868
879
  reload out of the box; each of these replaces that default:
869
880
 
870
- ````ts
881
+ ```ts
871
882
  storage: 'memory' // memory only: pair it with an httpOnly cookie session
872
- storage: createBrowserStorageAdapter({ kind: 'session' }) // survives a reload, dies with the tab
883
+ ```
873
884
 
874
- *(description truncated — read the full text in `node_modules/@molecule/app-auth/dist/browser-storage.d.ts`.)*
885
+ _(description truncated — read the full text in `node_modules/@molecule/app-auth/dist/browser-storage.d.ts`.)_
875
886
 
876
887
  ```typescript
877
888
  function createBrowserStorageAdapter(options?: BrowserStorageAdapterOptions): StorageAdapter
878
- ````
889
+ ```
879
890
 
880
891
  - `options` — Which Web Storage area to use, or a store to use directly.
881
892
 
@@ -1102,12 +1113,12 @@ by one. A box you can't check is an integration bug to fix — not a skip:
1102
1113
  - [ ] The session survives a FULL page reload: after login, hard-reload → you
1103
1114
  stay signed in (the profile/sign-out UI a signed-in visitor sees is still
1104
1115
  there), and you are NOT bounced to login. Which route does it is the app's
1105
- `AuthClientConfig.storage`: the scaffold's `createBrowserStorageAdapter()` keeps
1106
- the token in the browser, an httpOnly session cookie is restored by
1107
- `initialize()` through `currentUserEndpoint` (default `/users/me`). If the
1108
- app has neither — `storage` left at `'memory'` against an API that sets no
1109
- cookie — this box cannot be checked, and the fix is the config, not a token
1110
- store written beside the client.
1116
+ `AuthClientConfig.storage`: in a browser the client defaults to
1117
+ `createBrowserStorageAdapter()`, which keeps the token there; an httpOnly
1118
+ session cookie is restored by `initialize()` through `currentUserEndpoint`
1119
+ (default `/users/me`). If the app sets `storage: 'memory'` explicitly against
1120
+ an API that sets no cookie, this box cannot be checked, and the fix is the
1121
+ config, not a token store written beside the client.
1111
1122
  - [ ] Password reset round-trips: `requestPasswordReset({ email })` then
1112
1123
  `confirmPasswordReset({ token, password })` with the emailed token, after
1113
1124
  which `login()` with the NEW password succeeds and the OLD password no
@@ -38,10 +38,11 @@ export interface BrowserStorageAdapterOptions {
38
38
  * own `/me` call pays a round trip on EVERY navigation (xr-molecule-flash-m122: a 1–5 s restore
39
39
  * window, eight `waitForURL` timeouts).
40
40
  *
41
- * Pass it as `AuthClientConfig.storage` to keep the session across a page reload:
42
- * the client's default (`'memory'`) is lost on reload, and re-establishing the
43
- * session then needs a credential that survived — this adapter, or an httpOnly
44
- * session cookie the API sets (see the security note below).
41
+ * In a browser this IS the auth client's default `AuthClientConfig.storage`, so a scaffolded
42
+ * app keeps its session across a page reload with no extra wiring. Outside a browser (SSR, a Node
43
+ * test) the client defaults to `'memory'` instead, because there is no Web Storage to use. Pass
44
+ * `'memory'` explicitly to keep the bearer token out of script-reachable storage when the API sets
45
+ * an httpOnly session cookie (see the security note below).
45
46
  *
46
47
  * ```ts
47
48
  * import { createJWTAuthClient, createBrowserStorageAdapter } from '@molecule/app-auth'
@@ -52,7 +53,7 @@ export interface BrowserStorageAdapterOptions {
52
53
  * })
53
54
  * ```
54
55
  *
55
- * The scaffold's `authConfig` already passes it, so a scaffolded app survives a
56
+ * The browser client already defaults to it, so a scaffolded app survives a
56
57
  * reload out of the box; each of these replaces that default:
57
58
  *
58
59
  * ```ts
@@ -72,10 +73,11 @@ export interface BrowserStorageAdapterOptions {
72
73
  * your API supports it.** Script cannot read an httpOnly cookie, so an XSS
73
74
  * cannot exfiltrate the credential; the token stays in memory and
74
75
  * `initialize()` restores the session through `currentUserEndpoint`
75
- * (`@molecule/api-resource-user` issues exactly this cookie — that is why the
76
- * client's default is `'memory'`). If the API sets one, `storage: 'memory'` is
77
- * the strongest configuration. If it does not and you cannot change it, keep
78
- * the token's lifetime short and rotate it on refresh.
76
+ * (`@molecule/api-resource-user` issues exactly this cookie — pass
77
+ * `storage: 'memory'` when it does). `'memory'` is then the strongest
78
+ * configuration. If the API sets no such cookie and you cannot change that,
79
+ * this adapter is the alternative — keep the token's lifetime short and rotate
80
+ * it on refresh.
79
81
  * - **`kind: 'session'` narrows the window** to the tab's lifetime at the cost of
80
82
  * losing the session in a new tab; `'local'` is the default because a reload is
81
83
  * the requirement it exists for, and a fresh tab is the same person.
@@ -1 +1 @@
1
- {"version":3,"file":"browser-storage.d.ts","sourceRoot":"","sources":["../src/browser-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAA;AAEpD,4EAA4E;AAC5E,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,eAAO,MAAM,2BAA2B,GACtC,UAAS,4BAAiC,KACzC,cA6EF,CAAA"}
1
+ {"version":3,"file":"browser-storage.d.ts","sourceRoot":"","sources":["../src/browser-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,CAAA;AAEpD,4EAA4E;AAC5E,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;CACzB;AAeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,eAAO,MAAM,2BAA2B,GACtC,UAAS,4BAAiC,KACzC,cA6EF,CAAA"}
@@ -29,10 +29,11 @@ const warn = (message, error) => {
29
29
  * own `/me` call pays a round trip on EVERY navigation (xr-molecule-flash-m122: a 1–5 s restore
30
30
  * window, eight `waitForURL` timeouts).
31
31
  *
32
- * Pass it as `AuthClientConfig.storage` to keep the session across a page reload:
33
- * the client's default (`'memory'`) is lost on reload, and re-establishing the
34
- * session then needs a credential that survived — this adapter, or an httpOnly
35
- * session cookie the API sets (see the security note below).
32
+ * In a browser this IS the auth client's default `AuthClientConfig.storage`, so a scaffolded
33
+ * app keeps its session across a page reload with no extra wiring. Outside a browser (SSR, a Node
34
+ * test) the client defaults to `'memory'` instead, because there is no Web Storage to use. Pass
35
+ * `'memory'` explicitly to keep the bearer token out of script-reachable storage when the API sets
36
+ * an httpOnly session cookie (see the security note below).
36
37
  *
37
38
  * ```ts
38
39
  * import { createJWTAuthClient, createBrowserStorageAdapter } from '@molecule/app-auth'
@@ -43,7 +44,7 @@ const warn = (message, error) => {
43
44
  * })
44
45
  * ```
45
46
  *
46
- * The scaffold's `authConfig` already passes it, so a scaffolded app survives a
47
+ * The browser client already defaults to it, so a scaffolded app survives a
47
48
  * reload out of the box; each of these replaces that default:
48
49
  *
49
50
  * ```ts
@@ -63,10 +64,11 @@ const warn = (message, error) => {
63
64
  * your API supports it.** Script cannot read an httpOnly cookie, so an XSS
64
65
  * cannot exfiltrate the credential; the token stays in memory and
65
66
  * `initialize()` restores the session through `currentUserEndpoint`
66
- * (`@molecule/api-resource-user` issues exactly this cookie — that is why the
67
- * client's default is `'memory'`). If the API sets one, `storage: 'memory'` is
68
- * the strongest configuration. If it does not and you cannot change it, keep
69
- * the token's lifetime short and rotate it on refresh.
67
+ * (`@molecule/api-resource-user` issues exactly this cookie — pass
68
+ * `storage: 'memory'` when it does). `'memory'` is then the strongest
69
+ * configuration. If the API sets no such cookie and you cannot change that,
70
+ * this adapter is the alternative — keep the token's lifetime short and rotate
71
+ * it on refresh.
70
72
  * - **`kind: 'session'` narrows the window** to the tab's lifetime at the cost of
71
73
  * losing the session in a new tab; `'local'` is the default because a reload is
72
74
  * the requirement it exists for, and a fresh tab is the same person.
@@ -1 +1 @@
1
- {"version":3,"file":"browser-storage.js","sourceRoot":"","sources":["../src/browser-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AA8BhD,gFAAgF;AAChF,MAAM,IAAI,GAAG,CAAC,OAAe,EAA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MAAM,KAAK,GAAG,OAAO,EAAE,CAAA;YACvB,IAAI,CAAC,KAAK;gBAAE,OAAM;YAClB,IAAI,CAAC;gBACH,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAA;YACpD,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAUhB,WAAW,EACZ,MAAM,YAAY,CAAA;AA4CnB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC9B,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAEhE,SAAQ,gBAAqB,KAC5B,UAAU,CAAC,CAAC,EAAE,SAAS,CAokBzB,CAAA"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAUhB,WAAW,EACZ,MAAM,YAAY,CAAA;AAiEnB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC9B,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAEhE,SAAQ,gBAAqB,KAC5B,UAAU,CAAC,CAAC,EAAE,SAAS,CAqnBzB,CAAA"}
package/dist/client.js CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { I18nError } from '@molecule/app-i18n';
9
9
  import { getLogger } from '@molecule/app-logger';
10
+ import { createBrowserStorageAdapter } from './browser-storage.js';
10
11
  import { createTokenStorage, getTokenExpiration, isTokenExpired } from './token.js';
11
12
  /**
12
13
  * Whether this app is running inside a CROSS-SITE iframe — i.e. the molecule.dev
@@ -50,6 +51,27 @@ const clearSessionHintCookie = () => {
50
51
  const previewAttrs = isCrossSitePreviewFrame() ? '; Secure; SameSite=None; Partitioned' : '';
51
52
  document.cookie = `mol_auth=; Max-Age=0; path=/${previewAttrs}`;
52
53
  };
54
+ /**
55
+ * Whether a usable browser Web Storage exists — the condition under which the
56
+ * client's storage default is {@link createBrowserStorageAdapter} rather than
57
+ * `'memory'`.
58
+ *
59
+ * A browser app kept in memory loses the session on every full page load: a
60
+ * `page.goto` after sign-in signs the user out. Non-browser runtimes (SSR, a
61
+ * Node test) have no Web Storage, so they keep the in-memory default.
62
+ *
63
+ * @returns `true` when `window.localStorage` can be read.
64
+ */
65
+ const hasBrowserStorage = () => {
66
+ try {
67
+ return typeof window !== 'undefined' && typeof window.localStorage !== 'undefined';
68
+ }
69
+ catch (_error) {
70
+ // A blocked/opaque context can throw on the property access itself; without a
71
+ // readable store the client stays in memory (the non-browser default).
72
+ return false;
73
+ }
74
+ };
53
75
  /**
54
76
  * Creates a simple JWT-based auth client.
55
77
  *
@@ -63,8 +85,19 @@ const clearSessionHintCookie = () => {
63
85
  * @returns A fully configured `AuthClient` instance.
64
86
  */
65
87
  export const createJWTAuthClient = (config = {}) => {
66
- const { baseURL = '', loginEndpoint = '/auth/login', logoutEndpoint = '/users/logout', registerEndpoint = '/auth/register', refreshEndpoint = '/auth/refresh', profileEndpoint = '/auth/profile', forgotPasswordEndpoint = '/auth/password/reset', resetPasswordEndpoint = '/auth/password/reset/confirm', changePasswordEndpoint = '/auth/password/change', currentUserEndpoint = '/users/me', storagePrefix = 'molecule:auth:', storage = 'memory', shouldRestoreUser, autoRefresh = true, refreshBuffer = 60, } = config;
88
+ const { baseURL = '', loginEndpoint = '/auth/login', logoutEndpoint = '/users/logout', registerEndpoint = '/auth/register', refreshEndpoint = '/auth/refresh', profileEndpoint = '/auth/profile', forgotPasswordEndpoint = '/auth/password/reset', resetPasswordEndpoint = '/auth/password/reset/confirm', changePasswordEndpoint = '/auth/password/change', currentUserEndpoint = '/users/me', storagePrefix = 'molecule:auth:', storage: configuredStorage, shouldRestoreUser, autoRefresh = true, refreshBuffer = 60, } = config;
67
89
  const logger = getLogger('auth');
90
+ // In a browser the default is Web Storage: a session kept in memory is lost on
91
+ // every full page load, so a `page.goto` after sign-in signs the user out
92
+ // (xr-molecule-flash-m158: 40 of 65 local failures were this one default). SSR
93
+ // and Node tests have no Web Storage, so they keep `'memory'`.
94
+ const storage = configuredStorage ?? (hasBrowserStorage() ? createBrowserStorageAdapter() : 'memory');
95
+ // `tokenKey` exists so something OUTSIDE this client reads the token at its own
96
+ // key. An explicit in-memory store makes that impossible: nothing else can see
97
+ // the value, and a reload signs the user out.
98
+ if (config.tokenKey !== undefined && configuredStorage === 'memory') {
99
+ logger.warn(`tokenKey '${config.tokenKey}' is in memory — nothing outside this client can read it and a reload signs the user out; pass storage: createBrowserStorageAdapter()`);
100
+ }
68
101
  const tokenStorage = createTokenStorage(storage, storagePrefix, config.tokenKey);
69
102
  const stateListeners = new Set();
70
103
  const eventListeners = new Set();
@@ -91,7 +124,7 @@ export const createJWTAuthClient = (config = {}) => {
91
124
  /**
92
125
  * The status an update implies. `'unavailable'` is sticky until something
93
126
  * actually decides the session (a login/logout, a successful validation, or a
94
- * 4xx that cleared the token): a later `setState({ error })` must not turn
127
+ * 401/403 that cleared the token): a later `setState({ error })` must not turn
95
128
  * "the server did not answer" into "nobody is signed in".
96
129
  */
97
130
  const deriveStatus = (next, explicit) => {
@@ -185,9 +218,9 @@ export const createJWTAuthClient = (config = {}) => {
185
218
  const key = body.errorKey ?? 'auth.error.requestFailed';
186
219
  const fallback = body.error ?? body.message ?? 'Request failed';
187
220
  const failure = new I18nError(key, undefined, fallback);
188
- // The HTTP status, so a caller can tell "this token is dead" (4xx) from
189
- // "the server did not answer" (5xx) — `validateSession` keeps the session
190
- // on the latter and clears it on the former.
221
+ // The HTTP status, so a caller can tell "this token is dead" (401/403)
222
+ // from "the server did not answer" (5xx, network) or "the route does not
223
+ // exist" (404) — `validateSession` clears the session only on the first.
191
224
  failure.status = response.status;
192
225
  throw failure;
193
226
  }
@@ -241,13 +274,26 @@ export const createJWTAuthClient = (config = {}) => {
241
274
  return restoredUser;
242
275
  }
243
276
  }
244
- catch (_error) {
245
- // No valid session cookie (401) or no current-user endpoint — remain
246
- // logged out. This is an expected path for anonymous visitors. Drop the
247
- // presence hint: a stale hint (server-side session expired, or a DB
248
- // reset) would otherwise re-fire a guaranteed-401 probe on every load.
249
- // The next real login re-sets it alongside the fresh cookie.
250
- clearSessionHintCookie();
277
+ catch (error) {
278
+ const httpStatus = error.status;
279
+ // Only a REJECTED cookie (401/403) proves the hint stale: the session
280
+ // expired server-side, or the database was reset. Drop the hint then, so
281
+ // later loads skip a guaranteed-401 probe; the next login re-sets it.
282
+ if (httpStatus === 401 || httpStatus === 403) {
283
+ clearSessionHintCookie();
284
+ return null;
285
+ }
286
+ // Every other failure says nothing about the cookie. A 404 means the
287
+ // configured `currentUserEndpoint` does not exist (a config error the app
288
+ // fixes in source — the hint must survive to retry after the fix), and a
289
+ // 5xx or a network drop is transient. Stay logged out for THIS load, but
290
+ // keep the hint so a later load can still restore the session.
291
+ if (httpStatus === 404) {
292
+ logger.warn(`Session restore skipped — the current-user endpoint "${currentUserEndpoint}" was not found. Set currentUserEndpoint to your API's current-user route.`, error);
293
+ }
294
+ else {
295
+ logger.debug('Session restore skipped — the server could not confirm the cookie', error);
296
+ }
251
297
  }
252
298
  return null;
253
299
  };
@@ -518,9 +564,14 @@ export const createJWTAuthClient = (config = {}) => {
518
564
  }
519
565
  catch (error) {
520
566
  const httpStatus = error.status;
521
- if (httpStatus !== undefined && httpStatus >= 400 && httpStatus < 500) {
522
- // The token is dead (revoked, expired, a reset database): drop the
523
- // session rather than keep sending a header the server refuses.
567
+ // ONLY 401 and 403 are the server rejecting this token (revoked, expired,
568
+ // a reset database): drop the session rather than keep sending a header
569
+ // the server refuses. Any other status is not about the credential —
570
+ // most importantly a 404, which means `currentUserEndpoint` does not
571
+ // exist on this API. A route-not-found neither verifies nor rejects the
572
+ // token, so clearing it here signed every user out of a working session
573
+ // over a configuration mistake.
574
+ if (httpStatus === 401 || httpStatus === 403) {
524
575
  tokenStorage.clear();
525
576
  setState({
526
577
  initialized: true,
@@ -530,10 +581,18 @@ export const createJWTAuthClient = (config = {}) => {
530
581
  });
531
582
  return;
532
583
  }
533
- // The server could not answer. Keep the session so a later reload or a
534
- // retry can restore it; say so with `unavailable` instead of signing the
535
- // user out over a network failure.
536
- const message = error instanceof Error ? error.message : 'Session could not be confirmed';
584
+ // The server could not confirm the session. Keep the token AND the user
585
+ // so a later reload or a retry can restore them; say so with
586
+ // `unavailable` instead of signing the user out over a network failure,
587
+ // a 5xx, or a misplaced current-user route.
588
+ const message = httpStatus === 404
589
+ ? "The current-user endpoint was not found. Set currentUserEndpoint to your API's current-user route; the stored token was kept."
590
+ : error instanceof Error
591
+ ? error.message
592
+ : 'Session could not be confirmed';
593
+ if (httpStatus === 404) {
594
+ logger.warn(`validateSession could not verify the session — the current-user endpoint "${currentUserEndpoint}" was not found. Set currentUserEndpoint to your API's current-user route; the stored token was kept.`, error);
595
+ }
537
596
  setState({ status: 'unavailable', error: message });
538
597
  }
539
598
  },
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAgBnF;;;;;;;;;;;;;;;;GAgB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EAAE,CAAC,CAAA;YACrD,CAAC;QACH,CAAC;QAED,SAAS,CAAC,QAAuC;YAC/C,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAC5B,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAC9C,CAAC;QAED,YAAY,CAAC,QAAuC;YAClD,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAC5B,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAC9C,CAAC;QAED,QAAQ;YACN,OAAO,YAAY,CAAC,cAAc,EAAE,CAAA;QACtC,CAAC;QAED,gBAAgB,CAAC,QAA2B;YAC1C,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;YAC5B,OAAO,GAAG,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAC9C,CAAC;QAED,OAAO;YACL,IAAI,YAAY,EAAE,CAAC;gBACjB,YAAY,CAAC,YAAY,CAAC,CAAA;gBAC1B,YAAY,GAAG,IAAI,CAAA;YACrB,CAAC;YACD,cAAc,CAAC,KAAK,EAAE,CAAA;YACtB,cAAc,CAAC,KAAK,EAAE,CAAA;QACxB,CAAC;KACF,CAAA;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -35,13 +35,22 @@
35
35
  * Gate the fetch on the auth state being settled (`state.initialized`), or let
36
36
  * the HTTP client do it: `@molecule/app-bonds-default-react` registers
37
37
  * `whenRestored()` as the gate so every request waits for the restore.
38
+ * Waiting for the restore does NOT attach its token: a separately created HTTP
39
+ * client needs
40
+ * `createDefaultHttpClientWithAuthBearer({ baseURL, getToken: () => authClient.getAccessToken(), authScheme })`
41
+ * from `@molecule/app-bonds-default-react` plus
42
+ * `setAuthGate(() => authClient.whenRestored())` from `@molecule/app-http` — or
43
+ * the auth client built with `createDefaultAuthClientWithHttpSync`, which
44
+ * mirrors the token into the bonded client.
38
45
  *
39
46
  * **`getState().status` is the session state to render, in one value.**
40
47
  * `'loading'` (no decision yet) → `'authenticated'` / `'unauthenticated'`, and
41
48
  * `'unavailable'` when a stored session exists but the server could not confirm it.
42
49
  * `validateSession()` is the background re-check that produces the last two: call
43
- * it after the first render — a 4xx clears the token (`'unauthenticated'`), a
44
- * network failure or 5xx KEEPS it (`'unavailable'`, retryable). Do not build a
50
+ * it after the first render — a 401 or 403 clears the token (`'unauthenticated'`),
51
+ * while a network failure, a 5xx, or a 404 from a wrong `currentUserEndpoint`
52
+ * KEEPS the token and the user (`'unavailable'`, retryable; the 404 error names
53
+ * `currentUserEndpoint`). Do not build a
45
54
  * `validating`/`unavailable` flag beside the client: a second module-level state
46
55
  * plus its own listener set is a second session store, and it drifts from the
47
56
  * client's.
@@ -57,8 +66,10 @@
57
66
  *
58
67
  * **A token another tool reads at its own key is a CONFIG field, not a mirror.**
59
68
  * An e2e suite or host page that expects `localStorage.jwtToken` (the RealWorld
60
- * specs do) is satisfied by `tokenKey: 'jwtToken'` with
61
- * `storage: createBrowserStorageAdapter()`; writing the token into that key from a
69
+ * specs do) is satisfied by `tokenKey: 'jwtToken'` — in a browser the client's
70
+ * storage default is already `createBrowserStorageAdapter()`, so with an explicit
71
+ * `'memory'` store you must also pass
72
+ * `storage: createBrowserStorageAdapter()`. Writing the token into that key from a
62
73
  * subscription beside the client is a second store. In React, `useAuth()` from
63
74
  * `@molecule/app-react` returns the client's `state` (with `status`), `user` and
64
75
  * `isAuthenticated`; the token is `useAuthClient().getAccessToken()`.
@@ -154,12 +165,12 @@
154
165
  * - [ ] The session survives a FULL page reload: after login, hard-reload → you
155
166
  * stay signed in (the profile/sign-out UI a signed-in visitor sees is still
156
167
  * there), and you are NOT bounced to login. Which route does it is the app's
157
- * `AuthClientConfig.storage`: the scaffold's `createBrowserStorageAdapter()` keeps
158
- * the token in the browser, an httpOnly session cookie is restored by
159
- * `initialize()` through `currentUserEndpoint` (default `/users/me`). If the
160
- * app has neither — `storage` left at `'memory'` against an API that sets no
161
- * cookie — this box cannot be checked, and the fix is the config, not a token
162
- * store written beside the client.
168
+ * `AuthClientConfig.storage`: in a browser the client defaults to
169
+ * `createBrowserStorageAdapter()`, which keeps the token there; an httpOnly
170
+ * session cookie is restored by `initialize()` through `currentUserEndpoint`
171
+ * (default `/users/me`). If the app sets `storage: 'memory'` explicitly against
172
+ * an API that sets no cookie, this box cannot be checked, and the fix is the
173
+ * config, not a token store written beside the client.
163
174
  * - [ ] Password reset round-trips: `requestPasswordReset({ email })` then
164
175
  * `confirmPasswordReset({ token, password })` with the emailed token, after
165
176
  * which `login()` with the NEW password succeeds and the OLD password no
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgLG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2LG;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
@@ -35,13 +35,22 @@
35
35
  * Gate the fetch on the auth state being settled (`state.initialized`), or let
36
36
  * the HTTP client do it: `@molecule/app-bonds-default-react` registers
37
37
  * `whenRestored()` as the gate so every request waits for the restore.
38
+ * Waiting for the restore does NOT attach its token: a separately created HTTP
39
+ * client needs
40
+ * `createDefaultHttpClientWithAuthBearer({ baseURL, getToken: () => authClient.getAccessToken(), authScheme })`
41
+ * from `@molecule/app-bonds-default-react` plus
42
+ * `setAuthGate(() => authClient.whenRestored())` from `@molecule/app-http` — or
43
+ * the auth client built with `createDefaultAuthClientWithHttpSync`, which
44
+ * mirrors the token into the bonded client.
38
45
  *
39
46
  * **`getState().status` is the session state to render, in one value.**
40
47
  * `'loading'` (no decision yet) → `'authenticated'` / `'unauthenticated'`, and
41
48
  * `'unavailable'` when a stored session exists but the server could not confirm it.
42
49
  * `validateSession()` is the background re-check that produces the last two: call
43
- * it after the first render — a 4xx clears the token (`'unauthenticated'`), a
44
- * network failure or 5xx KEEPS it (`'unavailable'`, retryable). Do not build a
50
+ * it after the first render — a 401 or 403 clears the token (`'unauthenticated'`),
51
+ * while a network failure, a 5xx, or a 404 from a wrong `currentUserEndpoint`
52
+ * KEEPS the token and the user (`'unavailable'`, retryable; the 404 error names
53
+ * `currentUserEndpoint`). Do not build a
45
54
  * `validating`/`unavailable` flag beside the client: a second module-level state
46
55
  * plus its own listener set is a second session store, and it drifts from the
47
56
  * client's.
@@ -57,8 +66,10 @@
57
66
  *
58
67
  * **A token another tool reads at its own key is a CONFIG field, not a mirror.**
59
68
  * An e2e suite or host page that expects `localStorage.jwtToken` (the RealWorld
60
- * specs do) is satisfied by `tokenKey: 'jwtToken'` with
61
- * `storage: createBrowserStorageAdapter()`; writing the token into that key from a
69
+ * specs do) is satisfied by `tokenKey: 'jwtToken'` — in a browser the client's
70
+ * storage default is already `createBrowserStorageAdapter()`, so with an explicit
71
+ * `'memory'` store you must also pass
72
+ * `storage: createBrowserStorageAdapter()`. Writing the token into that key from a
62
73
  * subscription beside the client is a second store. In React, `useAuth()` from
63
74
  * `@molecule/app-react` returns the client's `state` (with `status`), `user` and
64
75
  * `isAuthenticated`; the token is `useAuthClient().getAccessToken()`.
@@ -154,12 +165,12 @@
154
165
  * - [ ] The session survives a FULL page reload: after login, hard-reload → you
155
166
  * stay signed in (the profile/sign-out UI a signed-in visitor sees is still
156
167
  * there), and you are NOT bounced to login. Which route does it is the app's
157
- * `AuthClientConfig.storage`: the scaffold's `createBrowserStorageAdapter()` keeps
158
- * the token in the browser, an httpOnly session cookie is restored by
159
- * `initialize()` through `currentUserEndpoint` (default `/users/me`). If the
160
- * app has neither — `storage` left at `'memory'` against an API that sets no
161
- * cookie — this box cannot be checked, and the fix is the config, not a token
162
- * store written beside the client.
168
+ * `AuthClientConfig.storage`: in a browser the client defaults to
169
+ * `createBrowserStorageAdapter()`, which keeps the token there; an httpOnly
170
+ * session cookie is restored by `initialize()` through `currentUserEndpoint`
171
+ * (default `/users/me`). If the app sets `storage: 'memory'` explicitly against
172
+ * an API that sets no cookie, this box cannot be checked, and the fix is the
173
+ * config, not a token store written beside the client.
163
174
  * - [ ] Password reset round-trips: `requestPasswordReset({ email })` then
164
175
  * `confirmPasswordReset({ token, password })` with the emailed token, after
165
176
  * 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgLG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2LG;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
@@ -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;;;;;;;;;;;;;;;;;;;;GAoBG;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"}
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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ACzB,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
@@ -300,11 +300,13 @@ export interface AuthClient<T = UserProfile, TRegister extends Record<string, un
300
300
  *
301
301
  * - The server confirms the user: the session is refreshed and {@link AuthState.status}
302
302
  * stays `'authenticated'`.
303
- * - The server answers 4xx: the token is dead — the stored session is cleared and
304
- * the status becomes `'unauthenticated'`.
305
- * - The server cannot answer (network failure or 5xx): the session is KEPT and the
306
- * status becomes `'unavailable'`, so the app can retry instead of signing the
307
- * user out over a bad connection.
303
+ * - The server answers 401 or 403: the token is dead — the stored session is
304
+ * cleared and the status becomes `'unauthenticated'`.
305
+ * - The server cannot confirm the session — a network failure, a 5xx, or a 404
306
+ * from a misconfigured {@link AuthClientConfig.currentUserEndpoint}: the
307
+ * session (token AND user) is KEPT and the status becomes `'unavailable'`, so
308
+ * the app can retry instead of signing the user out over a bad connection or a
309
+ * route that does not exist. The 404 error names `currentUserEndpoint`.
308
310
  *
309
311
  * Do not hand-write this beside the client: a parallel token/user store for a
310
312
  * "validating"/"unavailable" flag is the race this method removes.
@@ -393,11 +395,17 @@ export interface AuthClientConfig {
393
395
  */
394
396
  profileEndpoint?: string;
395
397
  /**
396
- * Current-user endpoint for session restore (default `/users/me`). Called by
397
- * `initialize()` with credentials to re-establish the session after a full page
398
- * load when the token did not survive the reload itself — i.e. when `storage` is
399
- * `'memory'` and the API sets an httpOnly session cookie. Must return the user
400
- * (as `user` or `props`).
398
+ * The API route that returns the signed-in user (default `/users/me`). Called
399
+ * with credentials by `initialize()` to re-establish the session after a full
400
+ * page load when the token did not survive the reload itself — i.e. when
401
+ * `storage` is `'memory'` and the API sets an httpOnly session cookie — and by
402
+ * {@link AuthClient.validateSession} on every reload to confirm a stored token
403
+ * is still valid. Must return the user (as `user` or `props`).
404
+ *
405
+ * Set it whenever the app serves its own current-user route: a wrong value
406
+ * answers 404, which `validateSession` reports as `'unavailable'` and keeps the
407
+ * stored token instead of signing the user out — but the session then stays
408
+ * unconfirmed.
401
409
  */
402
410
  currentUserEndpoint?: string;
403
411
  /**
@@ -413,6 +421,12 @@ export interface AuthClientConfig {
413
421
  * second library, a host page — instead of mirroring the token into
414
422
  * `localStorage` beside the client. The refresh token and the cached user keep
415
423
  * the prefix.
424
+ *
425
+ * In a browser the client's storage default is {@link createBrowserStorageAdapter},
426
+ * so `tokenKey` alone writes the token to exactly that key and a reload keeps
427
+ * the session. An EXPLICIT `storage: 'memory'` beside it warns at construction:
428
+ * the value then lives in a process-local Map nothing outside this client can
429
+ * read, and a reload signs the user out.
416
430
  */
417
431
  tokenKey?: string;
418
432
  /**
@@ -460,19 +474,21 @@ export interface AuthClientConfig {
460
474
  * Where the access/refresh token and the cached user are kept — the field that
461
475
  * decides whether a page reload keeps the user signed in.
462
476
  *
463
- * **In-memory is the secure default.** `'memory'` is a process-local store, lost
464
- * on reload. It is correct when the API sets an httpOnly session cookie, which
465
- * `initialize()` then restores through {@link AuthClientConfig.currentUserEndpoint}
466
- * — the strongest configuration, because no script can read the cookie.
477
+ * **In a browser the default is `createBrowserStorageAdapter()` (Web Storage)**,
478
+ * so a reload keeps the session with no wiring of its own; outside a browser
479
+ * (SSR, a Node test) the default is `'memory'`. Pass `'memory'` EXPLICITLY when
480
+ * the API sets an httpOnly session cookie and you do not want a script-readable
481
+ * copy: `'memory'` is a process-local store, and `initialize()` then restores
482
+ * through {@link AuthClientConfig.currentUserEndpoint} — the strongest
483
+ * configuration, because no script can read the cookie.
467
484
  *
468
- * **An app whose external contract requires a token in storage opts in
469
- * EXPLICITLY, with these two fields together.** A supplied e2e suite (the
470
- * RealWorld specs read `localStorage.jwtToken` in `SELECTORS.md`), a host page
471
- * or a second library can require the token at its own key: then set
472
- * `storage: createBrowserStorageAdapter()` and `tokenKey: 'jwtToken'`, and the
473
- * session (token AND user) is restored synchronously in `initialize()` — with no
474
- * store of your own. `tokenKey` places the access token at that exact key; the
475
- * refresh token and the cached user keep `storagePrefix`.
485
+ * **An app whose external contract requires the token at a specific key** — a
486
+ * supplied e2e suite (the RealWorld specs read `localStorage.jwtToken` in
487
+ * `SELECTORS.md`), a host page, a second library — sets `tokenKey: 'jwtToken'`;
488
+ * in a browser that is enough, because the default store is Web Storage. The
489
+ * session (token AND user) is then restored synchronously in `initialize()` —
490
+ * with no store of your own. `tokenKey` places the access token at that exact
491
+ * key; the refresh token and the cached user keep `storagePrefix`.
476
492
  *
477
493
  * A bearer token in Web Storage is readable by any script on the origin, so an
478
494
  * XSS can steal it; see {@link createBrowserStorageAdapter}'s `@remarks` for the
@@ -490,14 +506,13 @@ export interface AuthClientConfig {
490
506
  * ```typescript
491
507
  * import { createBrowserStorageAdapter } from '@molecule/app-auth'
492
508
  *
493
- * // A suite/host page reads the token at its own key — the opt-in:
509
+ * // A suite/host page reads the token at its own key (the browser default
510
+ * // already stores it; `storage` is shown for an explicit choice):
494
511
  * storage: createBrowserStorageAdapter()
495
512
  * tokenKey: 'jwtToken'
496
- * // A reload keeps the session at this client's own keys:
497
- * storage: createBrowserStorageAdapter()
498
513
  * // Only this tab's lifetime, at a narrower exposure than localStorage:
499
514
  * storage: createBrowserStorageAdapter({ kind: 'session' })
500
- * // An httpOnly cookie session instead — memory only, the stronger route:
515
+ * // An httpOnly cookie session — keep the bearer out of script-reachable storage:
501
516
  * storage: 'memory'
502
517
  * ```
503
518
  */
@@ -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;;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AKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAE/B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAE/B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,IAAI,MAAM,GAAG,IAAI,CAAA;IAC/B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC1C,eAAe,IAAI,MAAM,GAAG,IAAI,CAAA;IAChC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3C,OAAO,CAAC,CAAC,GAAG,WAAW,KAAK,CAAC,GAAG,IAAI,CAAA;IACpC,OAAO,CAAC,CAAC,GAAG,WAAW,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAA;IAC9C,KAAK,IAAI,IAAI,CAAA;CACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-auth",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Client-side authentication interface for molecule.dev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",