@softure-ai/auth 0.1.5 → 0.1.8

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.
Files changed (135) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +172 -24
  3. package/dist/contract.d.ts +3 -1
  4. package/dist/contract.d.ts.map +1 -1
  5. package/dist/contract.js.map +1 -1
  6. package/dist/index.d.ts +6 -0
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/messages/en.d.ts +1 -0
  11. package/dist/messages/en.d.ts.map +1 -1
  12. package/dist/messages/en.js +1 -0
  13. package/dist/messages/en.js.map +1 -1
  14. package/dist/messages/index.d.ts +2 -0
  15. package/dist/messages/index.d.ts.map +1 -1
  16. package/dist/messages/pl.d.ts.map +1 -1
  17. package/dist/messages/pl.js +1 -0
  18. package/dist/messages/pl.js.map +1 -1
  19. package/dist/next/actions.d.ts +9 -2
  20. package/dist/next/actions.d.ts.map +1 -1
  21. package/dist/next/actions.js +51 -18
  22. package/dist/next/actions.js.map +1 -1
  23. package/dist/next/context.js +2 -2
  24. package/dist/next/context.js.map +1 -1
  25. package/dist/next/index.d.ts +2 -2
  26. package/dist/next/index.d.ts.map +1 -1
  27. package/dist/next/index.js +1 -1
  28. package/dist/next/index.js.map +1 -1
  29. package/dist/next/logout-button.d.ts +3 -1
  30. package/dist/next/logout-button.d.ts.map +1 -1
  31. package/dist/next/logout-button.js +4 -4
  32. package/dist/next/logout-button.js.map +1 -1
  33. package/dist/next/pages.d.ts +13 -0
  34. package/dist/next/pages.d.ts.map +1 -1
  35. package/dist/next/pages.js +28 -2
  36. package/dist/next/pages.js.map +1 -1
  37. package/dist/next/session-cookie.d.ts +3 -0
  38. package/dist/next/session-cookie.d.ts.map +1 -1
  39. package/dist/next/session-cookie.js +39 -2
  40. package/dist/next/session-cookie.js.map +1 -1
  41. package/dist/options.d.ts +10 -1
  42. package/dist/options.d.ts.map +1 -1
  43. package/dist/options.js +44 -3
  44. package/dist/options.js.map +1 -1
  45. package/dist/proxy/index.d.ts +11 -0
  46. package/dist/proxy/index.d.ts.map +1 -1
  47. package/dist/proxy/index.js +60 -9
  48. package/dist/proxy/index.js.map +1 -1
  49. package/dist/safe-next-path.d.ts +3 -1
  50. package/dist/safe-next-path.d.ts.map +1 -1
  51. package/dist/safe-next-path.js +9 -3
  52. package/dist/safe-next-path.js.map +1 -1
  53. package/dist/scripts/index.d.ts +1 -0
  54. package/dist/scripts/index.d.ts.map +1 -1
  55. package/dist/scripts/index.js +3 -1
  56. package/dist/scripts/index.js.map +1 -1
  57. package/dist/scripts/temporary-password.d.ts +12 -0
  58. package/dist/scripts/temporary-password.d.ts.map +1 -0
  59. package/dist/scripts/temporary-password.js +47 -0
  60. package/dist/scripts/temporary-password.js.map +1 -0
  61. package/dist/server/change-password.d.ts +1 -1
  62. package/dist/server/change-password.d.ts.map +1 -1
  63. package/dist/server/change-password.js +4 -1
  64. package/dist/server/change-password.js.map +1 -1
  65. package/dist/server/index.d.ts +2 -2
  66. package/dist/server/index.d.ts.map +1 -1
  67. package/dist/server/index.js +2 -2
  68. package/dist/server/index.js.map +1 -1
  69. package/dist/server/login.js +5 -4
  70. package/dist/server/login.js.map +1 -1
  71. package/dist/server/options.d.ts +2 -0
  72. package/dist/server/options.d.ts.map +1 -1
  73. package/dist/server/options.js +14 -0
  74. package/dist/server/options.js.map +1 -1
  75. package/dist/server/password.d.ts +10 -3
  76. package/dist/server/password.d.ts.map +1 -1
  77. package/dist/server/password.js +24 -8
  78. package/dist/server/password.js.map +1 -1
  79. package/dist/server/rate-limits.d.ts +3 -2
  80. package/dist/server/rate-limits.d.ts.map +1 -1
  81. package/dist/server/rate-limits.js +9 -3
  82. package/dist/server/rate-limits.js.map +1 -1
  83. package/dist/server/register.d.ts +2 -0
  84. package/dist/server/register.d.ts.map +1 -1
  85. package/dist/server/register.js +13 -1
  86. package/dist/server/register.js.map +1 -1
  87. package/dist/server/session-token.d.ts +6 -2
  88. package/dist/server/session-token.d.ts.map +1 -1
  89. package/dist/server/session-token.js +7 -3
  90. package/dist/server/session-token.js.map +1 -1
  91. package/dist/server/sessions.d.ts +9 -0
  92. package/dist/server/sessions.d.ts.map +1 -1
  93. package/dist/server/sessions.js +13 -4
  94. package/dist/server/sessions.js.map +1 -1
  95. package/dist/testing/account.d.ts +17 -0
  96. package/dist/testing/account.d.ts.map +1 -0
  97. package/dist/testing/account.js +31 -0
  98. package/dist/testing/account.js.map +1 -0
  99. package/dist/testing/index.d.ts +2 -0
  100. package/dist/testing/index.d.ts.map +1 -0
  101. package/dist/testing/index.js +4 -0
  102. package/dist/testing/index.js.map +1 -0
  103. package/dist/ui/auth-forms.d.ts +14 -7
  104. package/dist/ui/auth-forms.d.ts.map +1 -1
  105. package/dist/ui/auth-forms.js +14 -12
  106. package/dist/ui/auth-forms.js.map +1 -1
  107. package/module.json +2 -2
  108. package/package.json +15 -3
  109. package/src/contract.ts +3 -0
  110. package/src/index.ts +2 -2
  111. package/src/messages/en.ts +1 -0
  112. package/src/messages/pl.ts +1 -0
  113. package/src/next/actions.ts +58 -16
  114. package/src/next/context.ts +2 -2
  115. package/src/next/index.ts +11 -1
  116. package/src/next/logout-button.tsx +5 -2
  117. package/src/next/pages.tsx +44 -0
  118. package/src/next/session-cookie.ts +42 -2
  119. package/src/options.ts +49 -3
  120. package/src/proxy/index.ts +78 -10
  121. package/src/safe-next-path.ts +9 -3
  122. package/src/scripts/index.ts +7 -1
  123. package/src/scripts/temporary-password.ts +62 -0
  124. package/src/server/change-password.ts +4 -1
  125. package/src/server/index.ts +10 -2
  126. package/src/server/login.ts +5 -5
  127. package/src/server/options.ts +15 -0
  128. package/src/server/password.ts +26 -8
  129. package/src/server/rate-limits.ts +10 -3
  130. package/src/server/register.ts +16 -1
  131. package/src/server/session-token.ts +7 -3
  132. package/src/server/sessions.ts +19 -4
  133. package/src/testing/account.ts +43 -0
  134. package/src/testing/index.ts +3 -0
  135. package/src/ui/auth-forms.tsx +26 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ Newest first. Each version lists what changed for an app that uses `@softure-ai/auth`. When an app has run a version in
4
+ production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
5
+ "Definition of done"). Versions before the first one below are described in their GitHub Releases (`auth@x.y.z`).
6
+
7
+ ## 0.1.8
8
+
9
+ - `logoutAction({ next })`, a `next` form field and `<LogoutButton next>` choose where logout goes; the path is
10
+ checked like login's `next` and falls back to `routes.afterLogout`.
11
+ - `createAuthGuard({ trustedOrigins })` keeps the login redirect on the request's public origin when it is listed;
12
+ without the option the redirect stays on `appOrigin`.
13
+ - README: when to set `cookie.secure` explicitly, and the Vitest `server.deps.inline` setting the `/next` entry needs.
14
+
15
+ ## 0.1.7
16
+
17
+ - `module.json` names `mailing` and `ops` as optional dependencies.
18
+ - Adapters and commands use the configured database handle; `@softure-ai/ui` is a peer dependency.
19
+ - Deny-by-default route guard and the legacy session cookie name.
20
+ - Registration fields, a register page factory, a submit variant and longer `next` paths.
21
+ - Legacy password hashes normalised to NFC, an unchanged new password refused, conditional reset buckets, session revocation.
22
+ - `set-temporary-password` ops script; `@softure-ai/ops` is an optional peer.
23
+ - `createTestAccount` in `@softure-ai/auth/testing`.
package/README.md CHANGED
@@ -2,31 +2,47 @@
2
2
 
3
3
  Accounts for a Next.js app: register with a required consent, login, logout, password change,
4
4
  password reset by an emailed link, roles with admin-only surfaces that fail closed, database sessions, a route guard for `proxy.ts`, and ready pages and forms. The reference module
5
- of the SOFTURE standard (docs/02): it has every layer, from migrations to messages. Built from
6
- FIRE_TRACKER's auth (`src/lib/{password,session}.ts`, `src/db/sessions.ts`,
7
- `src/app/actions/do-auth.ts`, `src/proxy.ts`), with the rate limiter of `@softure-ai/security`
8
- and the route guard separated from channel tagging.
5
+ of the SOFTURE standard (docs/02): it has every layer, from migrations to messages. It counts
6
+ attempts with the rate limiter of `@softure-ai/security`, and its route guard is separate from
7
+ channel tagging.
9
8
 
10
9
  ## 1. What it provides
11
10
 
12
11
  Users and sessions in the `auth` schema, scrypt password hashes, opaque session cookies, register,
13
12
  login, logout, password change and password reset as server actions and pages, `getCurrentUser` / `requireUser`
14
13
  for server code, roles (`requireRole`, `authorizeRole`, `hasRole`, and `grant-role` /
15
- `revoke-role` scripts), `createAuthGuard` for the app's `proxy.ts`, and a health check that
14
+ `revoke-role` scripts), account recovery (`revokeUserSessions` and a `set-temporary-password`
15
+ script), `createAuthGuard` for the app's `proxy.ts`, and a health check that
16
16
  `GET /api/health` of `@softure-ai/ops` runs (every auth table answers, no rows read).
17
17
  `@softure-ai/auth/mailing` sends password reset mails through `@softure-ai/mailing`
18
- (`mailingResetSender()`).
18
+ (`mailingResetSender()`). `@softure-ai/auth/testing` creates accounts directly in the database for
19
+ tests (`createTestAccount`, section 4, "Tests").
19
20
 
20
21
  ## 2. Installation
21
22
 
22
23
  ```bash
23
24
  npm install @softure-ai/auth @softure-ai/security @softure-ai/core @softure-ai/db @softure-ai/ui drizzle-orm
24
- # for the role scripts (section 4, "Roles"), already a dependency of auth:
25
+ # only for the ops scripts in @softure-ai/auth/scripts (section 4, "Roles" and "Account recovery"):
25
26
  npm install @softure-ai/ops
26
27
  ```
27
28
 
28
- Peer dependencies: `next` 16, `react` 19, `drizzle-orm`; `@softure-ai/mailing` (optional) for
29
- `@softure-ai/auth/mailing`.
29
+ Peer dependencies: `next` 16, `react` 19, `drizzle-orm`; optional: `@softure-ai/mailing` for
30
+ `@softure-ai/auth/mailing`, `@softure-ai/ops` for `@softure-ai/auth/scripts`. No other entry
31
+ imports them.
32
+
33
+ **Unit tests with Vitest.** `@softure-ai/auth/next` imports `next/headers`, `next/navigation` and
34
+ `next/server` without a file extension. Next's bundler resolves only those bare specifiers (the `.js`
35
+ form bypasses its per-runtime aliases and breaks `next build`), but Next has no `exports` map, so plain
36
+ Node ESM cannot resolve them: a Vitest test that imports the entry fails with
37
+ `Cannot find module '…/node_modules/next/headers'`. Let Vitest process the package instead of Node:
38
+
39
+ ```ts
40
+ // vitest.config.mts
41
+ export default defineConfig({ test: { server: { deps: { inline: [/@softure-ai\//] } } } });
42
+ ```
43
+
44
+ The pattern covers every `@softure-ai/*` package; the other modules' `/next` entries import Next the
45
+ same way.
30
46
 
31
47
  ## 3. Configuration
32
48
 
@@ -42,7 +58,7 @@ const config = defineSoftureConfig({
42
58
  timezone: "Europe/Warsaw",
43
59
  appOrigin: process.env.APP_ORIGIN!,
44
60
  modules: [
45
- // auth counts attempts in these four buckets; change the numbers, keep the names.
61
+ // auth counts attempts in these buckets; change the numbers, keep the names.
46
62
  security({ clientIp: cloudflareIp(), buckets: { ...AUTH_RATE_LIMIT_BUCKETS } }),
47
63
  auth({
48
64
  routes: { afterLogin: "/dashboard" },
@@ -61,12 +77,14 @@ export default config;
61
77
  | Option | Type | Default | Meaning |
62
78
  | --- | --- | --- | --- |
63
79
  | `password.minLength` | `number` (8-128) | `10` | Shortest new password, in characters. The longest is 1024. |
64
- | `password.scrypt` | `{ cost, blockSize, parallelization }` | `{ 2 ** 17, 8, 1 }` | scrypt N, r, p (OWASP). Raising them rehashes each password at its owner's next login. |
80
+ | `password.scrypt` | `{ cost, blockSize, parallelization }` | `{ 2 ** 17, 8, 1 }` | scrypt N, r, p (OWASP). Raising them rehashes each password at its owner's next login. Memory: 128 × N × r bytes per hash, so the default takes 128 MiB and about 0.4 s of one core; Node runs up to four hashes at once (its libuv pool, `UV_THREADPOOL_SIZE`), about 512 MiB at a burst of logins. On a small server, lower `cost` to `2 ** 16` (64 MiB) or `2 ** 15` (32 MiB) and leave the pool at four. |
65
81
  | `session.ttlDays` | `number` (1-365) | `30` | Session lifetime from login. It is not extended by use. |
66
82
  | `cookie.name` | `string` | `"softure_session"` | Base name of the session cookie (see below). |
67
83
  | `cookie.domain` | `string` | none (host-only) | Share the session with subdomains, e.g. `example.com` for the apex and `app.example.com`. |
68
- | `cookie.secure` | `boolean` | `appOrigin` is https | Send the cookie over HTTPS only. |
84
+ | `cookie.secure` | `boolean` | `appOrigin` is https | Send the cookie over HTTPS only. Set it explicitly when one build serves both HTTPS and plain HTTP (see below). |
69
85
  | `requireConsent` | `boolean` | `true` | Registration needs the consent checkbox. |
86
+ | `registrationFields` | `string[]` | `[]` | Extra register form fields handed to `onRegistered` as `event.fields` (section 10). Names: `a-z` first, then letters, digits or `_`, at most 32; not `email`, `password`, `next` or `consent`. |
87
+ | `legacySession` | `{ cookieName, tokenPattern }` | none | Sessions of the system the app took over (section 5, "Adopting existing sessions"). |
70
88
  | `registrationClosed` | `boolean` | `false` | Declared default of the `auth.registration_closed` switch. |
71
89
  | `roles` | `string[]` | `[]` | Role names the app checks besides `admin` (always declared): `a-z`, `0-9`, `_`, `-`, at most 32. |
72
90
  | `adminEmails` | `string[]` | `[]` | Initial admin list: while an email is listed, its account holds `admin`. Auth does not verify emails, so create these accounts before you deploy the list (section 4, "Roles"). |
@@ -79,18 +97,27 @@ export default config;
79
97
 
80
98
  **Cookie.** Always `HttpOnly`, `SameSite=Lax`, `Path=/`, `Max-Age` = the TTL. A secure cookie gets
81
99
  the prefix browsers enforce: `__Host-softure_session` when it is host-only, `__Secure-softure_session`
82
- with `cookie.domain`. Over plain HTTP (local development) it keeps the bare name.
100
+ with `cookie.domain`. Over plain HTTP (local development) it keeps the bare name. Without
101
+ `cookie.secure` the choice follows `appOrigin`'s scheme, read once from the config: an image built
102
+ with an `https:` origin and run over plain HTTP (a test stack on the production image) sets a
103
+ `__Host-` cookie the browser refuses, so no login sticks. Set `cookie.secure` from the deploy instead,
104
+ e.g. `cookie: { secure: process.env.ALLOW_INSECURE_COOKIES !== "true" }` with the variable set on
105
+ that stack only.
83
106
 
84
107
  **Rate limits** (`AUTH_RATE_LIMIT_BUCKETS`, configured in `security`): `register` 5 and `login` 50
85
108
  per client address, `login-account` 10 per email, `change-password` 10 per user,
86
109
  `password-reset` 10 (link requests) and `password-reset-confirm` 10 (new passwords) per client
87
110
  address, `password-reset-account` 3 per email (the mails one address can get), each per 15
88
111
  minutes. Attempts are counted before any password is hashed. A successful login forgets the
89
- email's failed attempts, not the address's. `login-account` is a lockout by design: ten wrong
112
+ email's failed attempts, not the address's: the per-address `login` bucket counts every login,
113
+ successful or not, so a test suite that logs in many times from one address must raise `login`
114
+ (or give each test its own address). `login-account` is a lockout by design: ten wrong
90
115
  passwords for one email, from any addresses, block logins to that account for the rest of the
91
116
  window, the owner's included. Raise its limit if that trade-off is wrong for your app. Auth checks
92
- at its first call that all seven buckets exist and names the missing ones. A request whose client address cannot be resolved is
93
- refused (`security.client_unidentified`); see the security README for resolvers.
117
+ at its first call that the buckets it counts in exist and names the missing ones: the three
118
+ `password-reset*` buckets only when `passwordReset.send` is set. A request whose client address
119
+ cannot be resolved is refused (`security.client_unidentified`); the security README shows resolver
120
+ chains for production and for development and test stacks.
94
121
 
95
122
  ## 4. Mounting
96
123
 
@@ -110,6 +137,27 @@ export { ResetPasswordPage as default } from "@softure-ai/auth/next";
110
137
  export { getSessionRoute as GET } from "@softure-ai/auth/next";
111
138
  ```
112
139
 
140
+ The register page takes a consent label (links to your terms) and inputs of your own through
141
+ `createRegisterPage`, so you keep the module's page:
142
+
143
+ ```tsx
144
+ // app/register/page.tsx
145
+ import { createRegisterPage } from "@softure-ai/auth/next";
146
+
147
+ export default createRegisterPage({
148
+ consentLabel: (
149
+ <>
150
+ I accept the <a href="/terms">terms</a> and the <a href="/privacy">privacy policy</a>.
151
+ </>
152
+ ),
153
+ extraFields: <input type="hidden" name="plan" value="pro" />,
154
+ });
155
+ ```
156
+
157
+ A field reaches `onRegistered` only when its name is in `auth({ registrationFields })` (section 10).
158
+ The page also carries a declared field from its own URL as a hidden input, so with
159
+ `registrationFields: ["z"]` a visit to `/register?z=newsletter` hands `{ z: "newsletter" }` to the hook.
160
+
113
161
  The server actions (`loginAction`, `registerAction`, `changePasswordAction`, `forgotPasswordAction`,
114
162
  `resetPasswordAction`, `logoutAction`) need no mounting. In your own pages and layouts:
115
163
 
@@ -127,6 +175,11 @@ export default async function AccountPage() {
127
175
  }
128
176
  ```
129
177
 
178
+ `<LogoutButton next="/login?next=…" />` (or `logoutAction({ next })` from the app's own action)
179
+ ends the session and goes to that path instead of `afterLogout`, e.g. a consent screen's "sign in as
180
+ someone else" returning to the same authorization request after the new login. The path is checked
181
+ like login's `next`: anything but a path on this app falls back to `afterLogout`.
182
+
130
183
  `requireUser({ next: "/account" })` brings the user back after login; `getCurrentUser()` returns
131
184
  the user or `null`. Both read the session once per request. The redirect to login goes through the
132
185
  app's `rewriteRedirect` (options table); a page outside the proxy's guard passes its own search
@@ -169,7 +222,34 @@ export const config = { matcher: ["/((?!_next/static|_next/image|favicon.ico).*)
169
222
  Next's `config`.)
170
223
 
171
224
  A protected prefix matches whole path segments (`/account` covers `/account/password`, not
172
- `/accounting`). The change-password route is always protected. Redirects are built on `appOrigin`.
225
+ `/accounting`). The change-password route is always protected. Redirects are built on `appOrigin`,
226
+ because behind a reverse proxy the request URL carries the server's internal host.
227
+
228
+ An app served on several hosts from one build (the product on `app.example.com`, pages on
229
+ `example.com`) lists the others in `trustedOrigins`, so a visitor is sent to the login page on the
230
+ host they used:
231
+
232
+ ```ts
233
+ const guard = createAuthGuard(softureConfig, { protect: ["/account"], trustedOrigins: ["https://example.com"] });
234
+ ```
235
+
236
+ The guard reads the request's public origin from `X-Forwarded-Proto` and `X-Forwarded-Host` (first
237
+ values), else from `Host` and the URL's scheme, and uses it only when it equals a listed origin
238
+ (scheme, host and port); any other request goes to `appOrigin`. Headers alone can therefore never
239
+ send a visitor to a host the app did not list. An entry that is not an `http(s)` origin throws when
240
+ the guard is created. A session cookie shared by the hosts needs `cookie.domain`.
241
+
242
+ An app that is private by default protects `"/"` and lists its public paths in `exclude`, which is
243
+ checked first:
244
+
245
+ ```ts
246
+ const guard = createAuthGuard(softureConfig, { protect: ["/"], exclude: ["/", "/pricing", "/blog", "/api/public"] });
247
+ ```
248
+
249
+ In `exclude`, `"/"` is the home page only; any other entry matches whole segments like `protect`.
250
+ Auth's own public pages (login, register, forgot and reset password) and `/api/auth/session` are
251
+ never guarded, so `protect: ["/"]` cannot send the login page to itself. The change-password route
252
+ stays guarded even under an excluded prefix.
173
253
 
174
254
  **Roles.** A role is a declared name (`admin`, plus `auth({ roles: ["editor"] })`) held by an
175
255
  account: as a row in `auth.user_roles`, or, for `admin` only, through `adminEmails`. Nothing is
@@ -221,6 +301,26 @@ not stored (revoke); an `admin` that comes from `adminEmails` is removed from th
221
301
  script. `grantRole`, `revokeRole` and `findUserRoles` in `@softure-ai/auth/server` do the same for
222
302
  your own code.
223
303
 
304
+ **Account recovery.** `revokeUserSessions(ctx, userId, { except? })` from `@softure-ai/auth/server`
305
+ ends every session of an account (all but `except`) and returns how many; each device logs in
306
+ again. For an owner who lost access without a reset mail, the `set-temporary-password` ops script
307
+ sets a random password (at least 20 characters, and at least `password.minLength`), ends every
308
+ session and the pending reset link, and prints the password once:
309
+
310
+ ```ts
311
+ // scripts/set-temporary-password.ts (bundled and run like grant-role)
312
+ import { createSetTemporaryPasswordScript } from "@softure-ai/auth/scripts";
313
+ import { runOpsScript } from "@softure-ai/ops/scripts";
314
+ import config from "../softure.config";
315
+
316
+ process.exitCode = await runOpsScript({ script: createSetTemporaryPasswordScript(config), argv: process.argv.slice(2), config });
317
+ ```
318
+
319
+ `node set-temporary-password.mjs --email=owner@example.com` shows what it would end and rolls back
320
+ (the printed password is not stored); `--commit` writes and prints the password to hand over. Send
321
+ it only to the account's own address, and ask the owner to change it after logging in: the module
322
+ does not force a change.
323
+
224
324
  **Password reset.** Pass a sender, and the login form links to the request page. With
225
325
  `@softure-ai/mailing` enabled, `mailingResetSender()` is that sender:
226
326
 
@@ -274,7 +374,28 @@ auth({
274
374
 
275
375
  **Your own forms.** `@softure-ai/auth/ui` exports `LoginForm`, `RegisterForm`,
276
376
  `ChangePasswordForm`, `ForgotPasswordForm` and `ResetPasswordForm`; pass them the actions from
277
- `@softure-ai/auth/next`.
377
+ `@softure-ai/auth/next`. `RegisterForm` takes `consentLabel` and `extraFields` like
378
+ `createRegisterPage`.
379
+
380
+ **Tests.** `createTestAccount(db, { email, password, roles?, scrypt? })` from `@softure-ai/auth/testing`
381
+ writes an account and its role rows in one transaction, hashed as registration hashes it, and returns
382
+ the `AuthUser`. It is for tests that need an account but are not about registration: no `onRegistered`
383
+ hook runs (no consent row) and no session is opened, so the test signs in through the login form.
384
+ Pass the app's parameters, so the first login does not rehash:
385
+
386
+ ```ts
387
+ import { getAuthOptions } from "@softure-ai/auth/server";
388
+ import { createTestAccount } from "@softure-ai/auth/testing";
389
+
390
+ const user = await createTestAccount(handle.db, {
391
+ email: "ada@example.com",
392
+ password: "correct horse battery",
393
+ roles: ["admin"],
394
+ scrypt: getAuthOptions(config).password.scrypt,
395
+ });
396
+ ```
397
+
398
+ An invalid or taken email throws. The entry is server-only and never imported by the module itself.
278
399
 
279
400
  ## 5. Migrations and tables
280
401
 
@@ -297,6 +418,26 @@ your own 1:1 table, never in `auth.users`. Expired sessions of a user are delete
297
418
  login; `pruneSessions(ctx)` from `@softure-ai/auth/server` deletes all of them for a scheduled job,
298
419
  and `prunePasswordResets(ctx)` does the same for expired reset links.
299
420
 
421
+ **Adopting existing sessions.** An app that moves to this module from its own auth can keep its
422
+ users, its password hashes when they are `scrypt$N$r$p$salt$key` strings, and its sessions when it
423
+ stored them as the sha256 hex of the token. Its cookie has another name and its tokens another
424
+ shape, so without more every user logs in once after the switch. To keep them signed in, declare
425
+ the old cookie:
426
+
427
+ ```ts
428
+ auth({ legacySession: { cookieName: "session", tokenPattern: /[0-9a-f]{64}/ } });
429
+ ```
430
+
431
+ `tokenPattern` describes the whole token (the module anchors it) and must not use the `g` or `y`
432
+ flag. While the current cookie is absent the old one is read, its token looked up by the same
433
+ sha256, and the route guard counts it. The next login, register or logout ends that session and
434
+ removes the old cookie (`Path=/` and `cookie.domain`; an old cookie set on another path or domain
435
+ stays until it expires, its session already ended). Legacy sessions keep their own expiry. Remove
436
+ the option once the longest of them has expired.
437
+
438
+ A password hashed from input that was not NFC still verifies: a login tries the input as given when
439
+ its NFC form fails, then rehashes it in NFC.
440
+
300
441
  ## 6. Environment variables
301
442
 
302
443
  | Name | Required | Meaning |
@@ -327,7 +468,8 @@ Without feature-switches, or while the app does not define the switch there, its
327
468
 
328
469
  Pages and forms are built from `@softure-ai/ui` (Card, fields, Checkbox, Button) and use only its
329
470
  compiled classes, so `@softure-ai/ui/styles.css` styles them and the `--sft-*` tokens theme them.
330
- Each form takes `classNames` for its slots (`root`, `form`, `footer`, `link`, `notice`) and
471
+ Each form takes `classNames` for its slots (`root`, `form`, `footer`, `link`, `notice`, and `submit`
472
+ for the submit button's class), `submitVariant` (a `Button` variant, `primary` by default) and
331
473
  `unstyled`; pages are server components you can replace with your own page around the forms.
332
474
 
333
475
  ## 9. Copy
@@ -341,10 +483,13 @@ looks one up.
341
483
 
342
484
  ## 10. Hooks
343
485
 
344
- `onRegistered({ user, consent }, ctx)`: after the user row is inserted, in the same transaction
345
- (`ctx.db` is the transaction). `consent` is `{ acceptedAt }`, or `null` with
346
- `requireConsent: false`. A thrown error rolls the registration back and the user sees a generic
347
- failure. `privacy` (engagement roadmap) stores the consent through it.
486
+ `onRegistered({ user, consent, fields }, ctx)`: after the user row is inserted, in the same
487
+ transaction (`ctx.db` is the transaction). `consent` is `{ acceptedAt }`, or `null` with
488
+ `requireConsent: false`. `fields` holds the declared `registrationFields` the form sent, by name
489
+ (strings cut to 512 characters, empty ones left out). They come from the client, and a link can set
490
+ a carried one, so validate them before you store them. The hook runs inside the register action,
491
+ so it can also read the request (`headers()`, `cookies()` from `next/headers`). A thrown error rolls the registration back and the user sees a generic
492
+ failure. `@softure-ai/privacy` stores the consent through it.
348
493
 
349
494
  `passwordReset.send(link, user, details)`: after a reset request is answered, for an existing
350
495
  account only (section 4, "Password reset"). `mailingResetSender()` from `@softure-ai/auth/mailing`
@@ -373,10 +518,13 @@ Rate limit rows of `security` hold only SHA-256 prefixes of the email and user i
373
518
 
374
519
  - Sessions have a fixed lifetime; there is no sliding renewal and no "remember me".
375
520
  - A password change keeps the session that made it (and ends every other one); the token itself
376
- is not rotated. Login and register end the session the browser held before.
521
+ is not rotated. The new password must differ from the current one (`auth.password_unchanged`). Login and register end the session the browser held before.
377
522
  - No email verification, so `adminEmails` trusts whoever registers a listed email first. (A reset
378
523
  link goes to the account's email, so its owner can take the account back.)
379
524
  - Roles are flat: no hierarchy and no permissions per role; no UI to manage them (the scripts do).
380
525
  - The guard checks cookie presence only; the session is verified by `requireUser`.
526
+ - A `next` path longer than 8192 characters is replaced by the default target, with a warning in
527
+ the log that names its length.
528
+ - A temporary password from the script is not forced to change at the next login.
381
529
  - A registration attempt reveals whether an email has an account (`auth.email_taken`); the
382
530
  `register` rate limit bounds how fast anyone can ask.
@@ -1,6 +1,6 @@
1
1
  import type { CoreErrorCode } from "@softure-ai/core";
2
2
  import type { SecurityErrorCode } from "@softure-ai/security";
3
- export type AuthErrorCode = "auth.invalid_credentials" | "auth.email_invalid" | "auth.email_taken" | "auth.password_too_short" | "auth.password_too_long" | "auth.consent_required" | "auth.registration_closed" | "auth.current_password_invalid" | "auth.unauthenticated" | "auth.forbidden" | "auth.reset_token_invalid" | "auth.password_reset_unavailable";
3
+ export type AuthErrorCode = "auth.invalid_credentials" | "auth.email_invalid" | "auth.email_taken" | "auth.password_too_short" | "auth.password_too_long" | "auth.consent_required" | "auth.registration_closed" | "auth.current_password_invalid" | "auth.password_unchanged" | "auth.unauthenticated" | "auth.forbidden" | "auth.reset_token_invalid" | "auth.password_reset_unavailable";
4
4
  /** Every code an auth form can show: its own, the rate limiter's and the generic ones. */
5
5
  export type AuthFormErrorCode = AuthErrorCode | Extract<SecurityErrorCode, "security.rate_limited" | "security.client_unidentified"> | CoreErrorCode;
6
6
  /** A signed-up account, as the app sees it. The password hash never leaves the module. */
@@ -25,6 +25,8 @@ export interface RegisteredEvent {
25
25
  readonly consent: {
26
26
  readonly acceptedAt: Date;
27
27
  } | null;
28
+ /** The declared `registrationFields` the form sent, by name; client input, so validate it. */
29
+ readonly fields: Readonly<Record<string, string>>;
28
30
  }
29
31
  /** The fields of the auth forms that can carry their own error. */
30
32
  export type AuthFormField = "email" | "password" | "currentPassword" | "newPassword" | "consent";
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,aAAa,GACrB,0BAA0B,GAC1B,oBAAoB,GACpB,kBAAkB,GAClB,yBAAyB,GACzB,wBAAwB,GACxB,uBAAuB,GACvB,0BAA0B,GAC1B,+BAA+B,GAC/B,sBAAsB,GACtB,gBAAgB,GAChB,0BAA0B,GAC1B,iCAAiC,CAAC;AAEtC,0FAA0F;AAC1F,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,OAAO,CAAC,iBAAiB,EAAE,uBAAuB,GAAG,8BAA8B,CAAC,GAAG,aAAa,CAAC;AAErJ,0FAA0F;AAC1F,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,iFAAiF;AACjF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED,sCAAsC;AACtC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;CAC9B;AAED,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,QAAQ,C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
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAkEA,MAAM,CAAC,MAAM,uBAAuB,GAAkB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -134,6 +134,7 @@ export declare const auth: import("@softure-ai/core").ModuleFactory<{
134
134
  consent_required: string;
135
135
  registration_closed: string;
136
136
  current_password_invalid: string;
137
+ password_unchanged: string;
137
138
  unauthenticated: string;
138
139
  forbidden: string;
139
140
  reset_token_invalid: string;
@@ -165,6 +166,11 @@ export declare const auth: import("@softure-ai/core").ModuleFactory<{
165
166
  domain: import("zod").ZodOptional<import("zod").ZodString>;
166
167
  secure: import("zod").ZodOptional<import("zod").ZodBoolean>;
167
168
  }, import("zod/v4/core").$strict>>;
169
+ legacySession: import("zod").ZodOptional<import("zod").ZodObject<{
170
+ cookieName: import("zod").ZodString;
171
+ tokenPattern: import("zod").ZodCustom<RegExp, RegExp>;
172
+ }, import("zod/v4/core").$strict>>;
173
+ registrationFields: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
168
174
  requireConsent: import("zod").ZodDefault<import("zod").ZodBoolean>;
169
175
  registrationClosed: import("zod").ZodDefault<import("zod").ZodBoolean>;
170
176
  roles: import("zod").ZodDefault<import("zod").ZodArray<import("zod").ZodString>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,2DAA2D;AAC3D,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,4CAA4C,CAAC;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ1B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAwCf,CAAC;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,UAAU,EACV,eAAe,EACf,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3F,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3I,OAAO,EAAE,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC7H,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -36,8 +36,8 @@ export const AUTH_RATE_LIMIT_BUCKETS = {
36
36
  export const auth = defineModule({
37
37
  manifest: {
38
38
  id: MODULE_ID,
39
- version: "0.1.5",
40
- dependsOn: { security: "^0.1.0" },
39
+ version: "0.1.8",
40
+ dependsOn: { security: "^0.1.0", mailing: "^0.1.0?", ops: "^0.1.0?" },
41
41
  dbSchema: "auth",
42
42
  tables: ["users", "sessions", "user_roles", "password_resets"],
43
43
  env: [
package/dist/index.js.map CHANGED
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,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC"}
@@ -79,6 +79,7 @@ export declare const en: {
79
79
  consent_required: string;
80
80
  registration_closed: string;
81
81
  current_password_invalid: string;
82
+ password_unchanged: string;
82
83
  unauthenticated: string;
83
84
  forbidden: string;
84
85
  reset_token_invalid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2DX,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BxF,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2DX,qFAAqF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCxF,CAAC"}
@@ -74,6 +74,7 @@ export const en = {
74
74
  consent_required: "You need to accept the terms to create an account.",
75
75
  registration_closed: "Registration is closed.",
76
76
  current_password_invalid: "The current password is incorrect.",
77
+ password_unchanged: "The new password must differ from the current one.",
77
78
  unauthenticated: "Your session has ended. Log in again.",
78
79
  forbidden: "You do not have access to this.",
79
80
  reset_token_invalid: "This link has expired or has already been used. Ask for a new one.",
@@ -1 +1 @@
1
- {"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,MAAM,EAAE;Q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AAE;QACN,MAAM,EAAE,SAAS;KAClB;IACD,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,mBAAmB,EAAE,qCAAqC;YAC1D,aAAa,EAAE,8BAA8B;YAC7C,WAAW,EAAE,4CAA4C;YACzD,kBAAkB,EAAE,4BAA4B;YAChD,iBAAiB,EAAE,2BAA2B;YAC9C,gBAAgB,EAAE,oDAAoD;YACtE,mBAAmB,EAAE,yBAAyB;YAC9C,wBAAwB,EAAE,oCAAoC;YAC9D,kBAAkB,EAAE,oDAAoD;YACxE,eAAe,EAAE,uCAAuC;YACxD,SAAS,EAAE,iCAAiC;YAC5C,mBAAmB,EAAE,oEAAoE;YACzF,0BAA0B,EAAE,kCAAkC;SAC/D;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,sDAAsD;YACpE,mBAAmB,EAAE,oEAAoE;SAC1F;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,0DAA0D;YAC3E,UAAU,EAAE,0DAA0D;SACvE;KACF;CACF,CAAC"}
@@ -82,6 +82,7 @@ export declare const authMessages: {
82
82
  consent_required: string;
83
83
  registration_closed: string;
84
84
  current_password_invalid: string;
85
+ password_unchanged: string;
85
86
  unauthenticated: string;
86
87
  forbidden: string;
87
88
  reset_token_invalid: string;
@@ -177,6 +178,7 @@ export declare const authMessages: {
177
178
  consent_required: string;
178
179
  registration_closed: string;
179
180
  current_password_invalid: string;
181
+ password_unchanged: string;
180
182
  unauthenticated: string;
181
183
  forbidden: string;
182
184
  reset_token_invalid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAG7B,6EAA6E;AAC7E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC;AAErC,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAI3F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAG7B,6EAA6E;AAC7E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC;AAErC,4EAA4E;AAC5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAI3F"}
@@ -1 +1 @@
1
- {"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../src/messages/pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAElC,eAAO,MAAM,EAAE,EAAE,OAAO,EAyFvB,CAAC"}
1
+ {"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../src/messages/pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAElC,eAAO,MAAM,EAAE,EAAE,OAAO,EA0FvB,CAAC"}
@@ -73,6 +73,7 @@ export const pl = {
73
73
  consent_required: "Aby założyć konto, zaakceptuj regulamin.",
74
74
  registration_closed: "Rejestracja jest zamknięta.",
75
75
  current_password_invalid: "Obecne hasło jest nieprawidłowe.",
76
+ password_unchanged: "Nowe hasło musi różnić się od obecnego.",
76
77
  unauthenticated: "Sesja wygasła. Zaloguj się ponownie.",
77
78
  forbidden: "Nie masz dostępu do tej funkcji.",
78
79
  reset_token_invalid: "Ten link wygasł albo został już użyty. Poproś o nowy.",
@@ -1 +1 @@
1
- {"version":3,"file":"pl.js","sourceRoot":"","sources":["../../src/messages/pl.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,EAAE,GAAc;IAC3B,MAAM,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,OAAO;QACjB,eAAe,EAAE,cAAc;QAC/B,WAAW,EAAE,YAAY;QACzB,eAAe,EAAE,iCAAiC;QAClD,OAAO,EAAE,6CAA6C;KACvD;IACD,KAAK,EAAE;QACL,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,yBAAyB;QACpC,YAAY,EAAE,UAAU;QACxB,cAAc,EAAE,sBAAsB;KACvC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,aAAa;QACtB,UAAU,EAAE,iBAAiB;QAC7B,SAAS,EAAE,aAAa;QACxB,WAAW,EAAE,4BAA4B;QACzC,UAAU,EAAE,iEAAiE;KAC9E;IACD,cAAc,EAAE;QACd,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,8EAA8E;QACpF,MAAM,EAAE,aAAa;QACrB,OAAO,EAA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,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,cAAc;QACvB,OAAO,EAAE,oDAAoD;QAC7D,YAAY,EAAE,qBAAqB;QACnC,WAAW,EAAE,mDAAmD;QAChE,UAAU,EAAE,kBAAkB;KAC/B;IACD,SAAS,EAAE;QACT,OAAO,EAAE,gBAAgB;QACzB,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,+FAA+F;QACtG,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,2CAA2C;QACnD,OAAO,EAAE,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE;QACzG,MAAM,EAAE,qEAAqE;KAC9E;IACD,MAAM,EAAE;QACN,MAAM,EAAE,aAAa;KACtB;IACD,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,mBAAmB,EAAE,iCAAiC;YACtD,aAAa,EAAE,gCAAgC;YAC/C,WAAW,EAAE,0CAA0C;YACvD,kBAAkB,EAAE,wBAAwB;YAC5C,iBAAiB,EAAE,uBAAuB;YAC1C,gBAAgB,EAAE,0CAA0C;YAC5D,mBAAmB,EAAE,6BAA6B;YAClD,wBAAwB,EAAE,kCAAkC;YAC5D,kBAAkB,EAAE,yCAAyC;YAC7D,eAAe,EAAE,sCAAsC;YACvD,SAAS,EAAE,kCAAkC;YAC7C,mBAAmB,EAAE,uDAAuD;YAC5E,0BAA0B,EAAE,+BAA+B;SAC5D;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,2DAA2D;YACzE,mBAAmB,EAAE,4EAA4E;SAClG;QACD,IAAI,EAAE;YACJ,eAAe,EAAE,mEAAmE;YACpF,UAAU,EAAE,mEAAmE;SAChF;KACF;CACF,CAAC"}
@@ -14,6 +14,13 @@ export declare function forgotPasswordAction(_previous: AuthFormState, formData:
14
14
  * and its token is used by then.
15
15
  */
16
16
  export declare function resetPasswordAction(_previous: AuthFormState, formData: FormData): Promise<AuthFormState>;
17
- /** Ends the request's session and goes to `afterLogout`. The cookie is cleared even if the delete fails. */
18
- export declare function logoutAction(): Promise<void>;
17
+ /** Where to go after logout: a path on this app, checked like login's `next`. */
18
+ export interface LogoutInput {
19
+ readonly next?: string;
20
+ }
21
+ /**
22
+ * Ends the request's sessions and goes to `next` (a form field or `{ next }`, e.g. `/login?next=…` to
23
+ * sign in as someone else), else to `afterLogout`. The cookies are cleared even if the delete fails.
24
+ */
25
+ export declare function logoutAction(input?: FormData | LogoutInput): Promise<void>;
19
26
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/next/actions.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAoC,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA4DtF,wBAAsB,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBtG;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAuBzG;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAgB/G;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAuB/G;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,CAkB9G;AAaD,4GAA4G;AAC5G,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAYlD"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/next/actions.ts"],"names":[],"mappings":"AAc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