@warlock.js/auth 5.31.0 → 5.33.0

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 (159) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esm/commands/auth-cleanup-command.d.mts +1 -2
  3. package/esm/commands/auth-cleanup-command.d.mts.map +1 -1
  4. package/esm/commands/auth-purge-never-expiring-command.d.mts +1 -2
  5. package/esm/commands/auth-purge-never-expiring-command.d.mts.map +1 -1
  6. package/esm/commands/jwt-secret-generator-command.d.mts +1 -2
  7. package/esm/commands/jwt-secret-generator-command.d.mts.map +1 -1
  8. package/esm/contracts/auth-contract.d.mts +1 -3
  9. package/esm/contracts/auth-contract.d.mts.map +1 -1
  10. package/esm/contracts/index.d.mts +2 -1
  11. package/esm/contracts/providers.d.mts +82 -50
  12. package/esm/contracts/providers.d.mts.map +1 -1
  13. package/esm/contracts/request-locals.d.mts +2 -3
  14. package/esm/contracts/request-locals.d.mts.map +1 -1
  15. package/esm/contracts/types.d.mts +59 -43
  16. package/esm/contracts/types.d.mts.map +1 -1
  17. package/esm/errors/auth-provider-sdk-missing.error.d.mts +1 -3
  18. package/esm/errors/auth-provider-sdk-missing.error.d.mts.map +1 -1
  19. package/esm/errors/email-not-verified.error.d.mts +1 -3
  20. package/esm/errors/email-not-verified.error.d.mts.map +1 -1
  21. package/esm/errors/index.d.mts +2 -1
  22. package/esm/errors/index.mjs +1 -1
  23. package/esm/errors/invalid-one-time-token.error.d.mts +1 -3
  24. package/esm/errors/invalid-one-time-token.error.d.mts.map +1 -1
  25. package/esm/errors/invalid-passkey.error.d.mts +1 -3
  26. package/esm/errors/invalid-passkey.error.d.mts.map +1 -1
  27. package/esm/errors/invalid-provider-callback.error.d.mts +1 -3
  28. package/esm/errors/invalid-provider-callback.error.d.mts.map +1 -1
  29. package/esm/errors/notifications-unavailable.error.d.mts +1 -3
  30. package/esm/errors/notifications-unavailable.error.d.mts.map +1 -1
  31. package/esm/errors/provider-email-not-verified.error.d.mts +1 -3
  32. package/esm/errors/provider-email-not-verified.error.d.mts.map +1 -1
  33. package/esm/index.d.mts +8 -0
  34. package/esm/localization/auth-default-translations.d.mts +1 -3
  35. package/esm/localization/auth-default-translations.d.mts.map +1 -1
  36. package/esm/localization/auth-translations.type.d.mts +11 -7
  37. package/esm/localization/auth-translations.type.d.mts.map +1 -1
  38. package/esm/localization/index.mjs +1 -1
  39. package/esm/localization/register-auth-translations.d.mts +1 -2
  40. package/esm/localization/register-auth-translations.d.mts.map +1 -1
  41. package/esm/middleware/auth.middleware.d.mts +10 -10
  42. package/esm/middleware/auth.middleware.d.mts.map +1 -1
  43. package/esm/middleware/csrf-origin-check.d.mts +4 -6
  44. package/esm/middleware/csrf-origin-check.d.mts.map +1 -1
  45. package/esm/middleware/csrf-origin-check.mjs +1 -1
  46. package/esm/middleware/csrf-origin-check.mjs.map +1 -1
  47. package/esm/middleware/index.d.mts +2 -1
  48. package/esm/middleware/index.mjs +1 -1
  49. package/esm/middleware/login-throttle.middleware.d.mts +4 -6
  50. package/esm/middleware/login-throttle.middleware.d.mts.map +1 -1
  51. package/esm/middleware/one-time-token-throttle.middleware.d.mts +2 -4
  52. package/esm/middleware/one-time-token-throttle.middleware.d.mts.map +1 -1
  53. package/esm/middleware/otp-throttle.middleware.d.mts +2 -4
  54. package/esm/middleware/otp-throttle.middleware.d.mts.map +1 -1
  55. package/esm/middleware/require-verified-email.middleware.d.mts +1 -3
  56. package/esm/middleware/require-verified-email.middleware.d.mts.map +1 -1
  57. package/esm/models/access-token/access-token.model.d.mts +6 -6
  58. package/esm/models/access-token/access-token.model.d.mts.map +1 -1
  59. package/esm/models/access-token/index.d.mts +2 -1
  60. package/esm/models/access-token/index.mjs +1 -1
  61. package/esm/models/auth-token-family/auth-token-family.model.d.mts +2 -4
  62. package/esm/models/auth-token-family/auth-token-family.model.d.mts.map +1 -1
  63. package/esm/models/auth-token-family/index.d.mts +2 -1
  64. package/esm/models/auth-token-family/index.mjs +1 -1
  65. package/esm/models/auth.model.d.mts +1 -3
  66. package/esm/models/auth.model.d.mts.map +1 -1
  67. package/esm/models/index.d.mts +8 -2
  68. package/esm/models/index.d.mts.map +1 -1
  69. package/esm/models/index.mjs +1 -1
  70. package/esm/models/one-time-token/index.d.mts +2 -1
  71. package/esm/models/one-time-token/index.mjs +1 -1
  72. package/esm/models/one-time-token/one-time-token.model.d.mts +3 -5
  73. package/esm/models/one-time-token/one-time-token.model.d.mts.map +1 -1
  74. package/esm/models/passkey-credential/index.d.mts +2 -1
  75. package/esm/models/passkey-credential/index.mjs +1 -1
  76. package/esm/models/passkey-credential/passkey-credential.model.d.mts +2 -4
  77. package/esm/models/passkey-credential/passkey-credential.model.d.mts.map +1 -1
  78. package/esm/models/provider-account/index.d.mts +2 -1
  79. package/esm/models/provider-account/index.mjs +1 -1
  80. package/esm/models/provider-account/provider-account.model.d.mts +2 -4
  81. package/esm/models/provider-account/provider-account.model.d.mts.map +1 -1
  82. package/esm/models/refresh-token/index.d.mts +2 -1
  83. package/esm/models/refresh-token/index.mjs +1 -1
  84. package/esm/models/refresh-token/refresh-token.model.d.mts +7 -7
  85. package/esm/models/refresh-token/refresh-token.model.d.mts.map +1 -1
  86. package/esm/otp/index.d.mts +2 -1
  87. package/esm/otp/index.mjs +1 -1
  88. package/esm/otp/otp.d.mts +2 -4
  89. package/esm/otp/otp.d.mts.map +1 -1
  90. package/esm/otp/otp.mjs +2 -1
  91. package/esm/otp/otp.mjs.map +1 -1
  92. package/esm/passkeys/index.d.mts +2 -1
  93. package/esm/passkeys/index.mjs +1 -1
  94. package/esm/passkeys/passkey-authentication.d.mts +2 -4
  95. package/esm/passkeys/passkey-authentication.d.mts.map +1 -1
  96. package/esm/passkeys/passkey-authentication.mjs +2 -1
  97. package/esm/passkeys/passkey-authentication.mjs.map +1 -1
  98. package/esm/passkeys/passkey-registration.d.mts +3 -4
  99. package/esm/passkeys/passkey-registration.d.mts.map +1 -1
  100. package/esm/passkeys/simplewebauthn.d.mts +2 -3
  101. package/esm/passkeys/simplewebauthn.d.mts.map +1 -1
  102. package/esm/passkeys/simplewebauthn.mjs +1 -1
  103. package/esm/providers/apple-provider.d.mts +5 -9
  104. package/esm/providers/apple-provider.d.mts.map +1 -1
  105. package/esm/providers/discord-provider.d.mts +2 -7
  106. package/esm/providers/discord-provider.d.mts.map +1 -1
  107. package/esm/providers/facebook-provider.d.mts +2 -7
  108. package/esm/providers/facebook-provider.d.mts.map +1 -1
  109. package/esm/providers/github-provider.d.mts +2 -7
  110. package/esm/providers/github-provider.d.mts.map +1 -1
  111. package/esm/providers/google-provider.d.mts +5 -10
  112. package/esm/providers/google-provider.d.mts.map +1 -1
  113. package/esm/providers/index.d.mts +2 -1
  114. package/esm/providers/index.mjs +1 -1
  115. package/esm/providers/linkedin-provider.d.mts +3 -8
  116. package/esm/providers/linkedin-provider.d.mts.map +1 -1
  117. package/esm/providers/provider-login.d.mts +3 -5
  118. package/esm/providers/provider-login.d.mts.map +1 -1
  119. package/esm/providers/provider-login.mjs +3 -2
  120. package/esm/providers/provider-login.mjs.map +1 -1
  121. package/esm/providers/provider-state-cookie.mjs +3 -2
  122. package/esm/providers/provider-state-cookie.mjs.map +1 -1
  123. package/esm/providers/x-provider.d.mts +2 -7
  124. package/esm/providers/x-provider.d.mts.map +1 -1
  125. package/esm/services/auth-events.d.mts +5 -6
  126. package/esm/services/auth-events.d.mts.map +1 -1
  127. package/esm/services/auth.service.d.mts +10 -9
  128. package/esm/services/auth.service.d.mts.map +1 -1
  129. package/esm/services/current-user.d.mts +1 -3
  130. package/esm/services/current-user.d.mts.map +1 -1
  131. package/esm/services/email-verification.d.mts +3 -5
  132. package/esm/services/email-verification.d.mts.map +1 -1
  133. package/esm/services/generate-jwt-secret.d.mts +1 -2
  134. package/esm/services/generate-jwt-secret.d.mts.map +1 -1
  135. package/esm/services/index.d.mts +2 -1
  136. package/esm/services/index.mjs +1 -1
  137. package/esm/services/jwt.d.mts +8 -29
  138. package/esm/services/jwt.d.mts.map +1 -1
  139. package/esm/services/jwt.mjs +2 -2
  140. package/esm/services/jwt.mjs.map +1 -1
  141. package/esm/services/one-time-tokens.d.mts +6 -6
  142. package/esm/services/one-time-tokens.d.mts.map +1 -1
  143. package/esm/services/password-reset.d.mts +2 -4
  144. package/esm/services/password-reset.d.mts.map +1 -1
  145. package/esm/services/resolve-request-user.d.mts +19 -14
  146. package/esm/services/resolve-request-user.d.mts.map +1 -1
  147. package/esm/services/token-family-operation.mjs +1 -1
  148. package/esm/session/index.d.mts +2 -1
  149. package/esm/session/index.mjs +1 -1
  150. package/esm/session/page-session.d.mts +26 -18
  151. package/esm/session/page-session.d.mts.map +1 -1
  152. package/esm/utils/auth-error-codes.d.mts +11 -22
  153. package/esm/utils/auth-error-codes.d.mts.map +1 -1
  154. package/esm/utils/index.mjs +1 -1
  155. package/esm/utils/safe-equal.d.mts +1 -2
  156. package/esm/utils/safe-equal.d.mts.map +1 -1
  157. package/esm/utils/token-expiry.d.mts +3 -4
  158. package/esm/utils/token-expiry.d.mts.map +1 -1
  159. package/package.json +8 -8
@@ -1,12 +1,14 @@
1
1
  import { Auth } from "../models/auth.model.mjs";
2
2
  import { AccessToken } from "../models/access-token/access-token.model.mjs";
3
+ import "../models/access-token/index.mjs";
3
4
  import { OneTimeToken } from "../models/one-time-token/one-time-token.model.mjs";
5
+ import "../models/one-time-token/index.mjs";
4
6
  import { OtpConfig, PasskeysConfig, ProvidersConfig } from "./providers.mjs";
7
+ import "../models/refresh-token/index.mjs";
5
8
  import { RefreshToken } from "../models/refresh-token/refresh-token.model.mjs";
6
9
  import { Request } from "@warlock.js/core";
7
10
  import { ChildModel } from "@warlock.js/cascade";
8
11
  import { Algorithm } from "fast-jwt";
9
-
10
12
  //#region ../../packages/auth/src/contracts/types.d.ts
11
13
  /**
12
14
  * Symbol to indicate no expiration for tokens
@@ -27,27 +29,27 @@ import { Algorithm } from "fast-jwt";
27
29
  * export default authConfigurations;
28
30
  * ```
29
31
  */
30
- declare const NO_EXPIRATION = "100y";
32
+ export declare const NO_EXPIRATION = "100y";
31
33
  /**
32
34
  * Behavior when logout is called without a refresh token
33
35
  * - "revoke-all": Revoke all refresh tokens for the user (secure default)
34
36
  * - "error": Return an error requiring the refresh token
35
37
  */
36
- type LogoutWithoutTokenBehavior = "revoke-all" | "error";
38
+ export type LogoutWithoutTokenBehavior = "revoke-all" | "error";
37
39
  /** The single request credential source an auth middleware instance accepts. */
38
- type TokenFrom = "header" | `cookie:${string}`;
40
+ export type TokenFrom = "header" | `cookie:${string}`;
39
41
  /** One explicitly named credential location accepted by auth middleware. */
40
- interface AuthCredentialDescriptor {
42
+ export interface AuthCredentialDescriptor {
41
43
  source: "header" | "cookie";
42
44
  key?: string;
43
45
  }
44
46
  /** Cookie credential and bounded duplicate window for automatic renewal. */
45
- interface AuthRefreshCredentialDescriptor extends AuthCredentialDescriptor {
47
+ export interface AuthRefreshCredentialDescriptor extends AuthCredentialDescriptor {
46
48
  /** Milliseconds; the service clamps this to the 0–10 second range (default 5 seconds). */
47
49
  overlapMs?: number;
48
50
  }
49
51
  /** Per-route authentication behavior for the object middleware overload. */
50
- interface AuthMiddlewareOptions extends Partial<AuthCredentialDescriptor> {
52
+ export interface AuthMiddlewareOptions extends Partial<AuthCredentialDescriptor> {
51
53
  optional?: boolean;
52
54
  /**
53
55
  * Accept both a header and a cookie credential (at most one of each).
@@ -65,9 +67,9 @@ interface AuthMiddlewareOptions extends Partial<AuthCredentialDescriptor> {
65
67
  };
66
68
  }
67
69
  /** Application policy that decides whether a resolved user may authenticate. */
68
- type CanAuthenticate = (user: Auth) => boolean | Promise<boolean>;
70
+ export type CanAuthenticate = (user: Auth) => boolean | Promise<boolean>;
69
71
  /** Password credentials plus the application-defined identity fields. */
70
- type AuthCredentials = Record<string, unknown> & {
72
+ export type AuthCredentials = Record<string, unknown> & {
71
73
  password: string;
72
74
  };
73
75
  /**
@@ -76,7 +78,7 @@ type AuthCredentials = Record<string, unknown> & {
76
78
  * `secret` may also be supplied via the deprecated `jwt.secret` (resolved by a
77
79
  * backward-compatible shim); one of the two is required at runtime.
78
80
  */
79
- type AccessTokenConfig = {
81
+ export type AccessTokenConfig = {
80
82
  /**
81
83
  * Override the persisted access-token model — extend {@link AccessToken} to
82
84
  * add columns (e.g. a tenant key) or rename them, then register the subclass
@@ -106,7 +108,7 @@ type AccessTokenConfig = {
106
108
  /**
107
109
  * Refresh-token configuration.
108
110
  */
109
- type RefreshTokenConfig = {
111
+ export type RefreshTokenConfig = {
110
112
  /**
111
113
  * Override the persisted refresh-token model — extend {@link RefreshToken}.
112
114
  * Defaults to the package's `RefreshToken`.
@@ -152,7 +154,7 @@ type RefreshTokenConfig = {
152
154
  *
153
155
  * @deprecated Use the top-level `accessToken` / `refreshToken` blocks.
154
156
  */
155
- type LegacyJwtConfig = {
157
+ export type LegacyJwtConfig = {
156
158
  secret?: string;
157
159
  algorithm?: Algorithm;
158
160
  expiresIn?: string;
@@ -173,7 +175,7 @@ type LegacyJwtConfig = {
173
175
  * Read at runtime through `authConfig.pageAuth` (`auth.pageAuth.*`). API routes
174
176
  * always keep the JSON 401 contract regardless of this setting.
175
177
  */
176
- type PageAuthConfig = {
178
+ export type PageAuthConfig = {
177
179
  /**
178
180
  * Login path a guarded page route redirects a logged-out browser to (e.g.
179
181
  * `"/login"`). Unset ⇒ page-route auth failures keep the JSON 401, so the
@@ -190,26 +192,29 @@ type PageAuthConfig = {
190
192
  /**
191
193
  * Data every email-verification / password-reset notification receives.
192
194
  */
193
- type OneTimeTokenNotificationData = {
194
- /** The raw token — the only place it exists; only its SHA-256 hash is stored. */token: string; /** When the token stops working. */
195
- expiresAt: Date; /** The link built by `auth.verification.url` / `auth.passwordReset.url`, when configured. */
195
+ export type OneTimeTokenNotificationData = {
196
+ /** The raw token — the only place it exists; only its SHA-256 hash is stored. */
197
+ token: string;
198
+ /** When the token stops working. */
199
+ expiresAt: Date;
200
+ /** The link built by `auth.verification.url` / `auth.passwordReset.url`, when configured. */
196
201
  url?: string;
197
202
  };
198
203
  /**
199
204
  * Anything auth can deliver a token through — a `defineNotification(...)`
200
205
  * result satisfies it, as does any object with a compatible `send`.
201
206
  */
202
- type AuthNotification = {
207
+ export type AuthNotification = {
203
208
  send: (to: Auth, data: OneTimeTokenNotificationData) => unknown;
204
209
  };
205
210
  /** Builds the link a token notification points at. */
206
- type OneTimeTokenUrlBuilder = (token: string, user: Auth) => string;
211
+ export type OneTimeTokenUrlBuilder = (token: string, user: Auth) => string;
207
212
  /** Persists a new plaintext password for a user during a password reset. */
208
- type PasswordSetter = (user: Auth, plainPassword: string) => void | Promise<void>;
213
+ export type PasswordSetter = (user: Auth, plainPassword: string) => void | Promise<void>;
209
214
  /**
210
215
  * Email-verification configuration (`auth.verification`).
211
216
  */
212
- type EmailVerificationConfig = {
217
+ export type EmailVerificationConfig = {
213
218
  /**
214
219
  * Token lifetime — a positive `ms` duration string.
215
220
  * @default "24h"
@@ -220,14 +225,16 @@ type EmailVerificationConfig = {
220
225
  * user schema (e.g. `emailVerifiedAt: v.date().optional()`).
221
226
  * @default "emailVerifiedAt"
222
227
  */
223
- field?: string; /** Replace the default verification email. */
224
- notification?: AuthNotification; /** Build the verification link passed to the notification as `url`. */
228
+ field?: string;
229
+ /** Replace the default verification email. */
230
+ notification?: AuthNotification;
231
+ /** Build the verification link passed to the notification as `url`. */
225
232
  url?: OneTimeTokenUrlBuilder;
226
233
  };
227
234
  /**
228
235
  * Password-reset configuration (`auth.passwordReset`).
229
236
  */
230
- type PasswordResetConfig = {
237
+ export type PasswordResetConfig = {
231
238
  /**
232
239
  * Token lifetime — a positive `ms` duration string.
233
240
  * @default "60m"
@@ -237,8 +244,10 @@ type PasswordResetConfig = {
237
244
  * User attribute `requestPasswordReset` looks the account up by.
238
245
  * @default "email"
239
246
  */
240
- identifierField?: string; /** Replace the default reset email. */
241
- notification?: AuthNotification; /** Build the reset link passed to the notification as `url`. */
247
+ identifierField?: string;
248
+ /** Replace the default reset email. */
249
+ notification?: AuthNotification;
250
+ /** Build the reset link passed to the notification as `url`. */
242
251
  url?: OneTimeTokenUrlBuilder;
243
252
  /**
244
253
  * Persist the new password yourself. By default auth saves a hash made by
@@ -251,17 +260,19 @@ type PasswordResetConfig = {
251
260
  /**
252
261
  * One-time token storage configuration (`auth.oneTimeToken`).
253
262
  */
254
- type OneTimeTokenConfig = {
255
- /** Override the persisted model — extend {@link OneTimeToken}. */model?: typeof OneTimeToken;
263
+ export type OneTimeTokenConfig = {
264
+ /** Override the persisted model — extend {@link OneTimeToken}. */
265
+ model?: typeof OneTimeToken;
256
266
  };
257
- type AuthConfigurations = {
267
+ export type AuthConfigurations = {
258
268
  /**
259
269
  * Define all user types — maps a user-type slug to its `Auth` model class so
260
270
  * tokens and the middleware can resolve the right model.
261
271
  */
262
272
  userType: {
263
273
  [userType: string]: ChildModel<Auth>;
264
- }; /** Default user type used by `authMiddleware()` and options-only overloads. */
274
+ };
275
+ /** Default user type used by `authMiddleware()` and options-only overloads. */
265
276
  defaultUserType?: string;
266
277
  /**
267
278
  * Decide whether a resolved user may authenticate or receive new tokens.
@@ -321,7 +332,7 @@ type AuthConfigurations = {
321
332
  */
322
333
  jwt?: LegacyJwtConfig;
323
334
  };
324
- type AccessTokenOutput = {
335
+ export type AccessTokenOutput = {
325
336
  /**
326
337
  * JWT Token
327
338
  */
@@ -334,7 +345,7 @@ type AccessTokenOutput = {
334
345
  /**
335
346
  * Token pair returned after login or token refresh
336
347
  */
337
- type TokenPair = {
348
+ export type TokenPair = {
338
349
  /**
339
350
  * JWT access token (short-lived)
340
351
  */
@@ -347,7 +358,7 @@ type TokenPair = {
347
358
  /**
348
359
  * Device information for session tracking
349
360
  */
350
- type DeviceInfo = {
361
+ export type DeviceInfo = {
351
362
  /**
352
363
  * User agent string from request
353
364
  */
@@ -370,12 +381,12 @@ type DeviceInfo = {
370
381
  */
371
382
  payload?: Record<string, unknown>;
372
383
  };
373
- type LoginResult<UserType extends Auth> = {
384
+ export type LoginResult<UserType extends Auth> = {
374
385
  user: UserType;
375
386
  tokens: TokenPair;
376
387
  };
377
388
  /** Selects a cookie Domain for one request; return `undefined` for a host-only cookie. */
378
- type CookieDomainResolver = (request: Request) => string | undefined;
389
+ export type CookieDomainResolver = (request: Request) => string | undefined;
379
390
  /**
380
391
  * Configuration for the cookie an app opts into via `authService.setAuthCookie`
381
392
  * / `clearAuthCookie` and reads back with `authMiddleware([], "cookie:<name>")`.
@@ -384,7 +395,7 @@ type CookieDomainResolver = (request: Request) => string | undefined;
384
395
  * same floor every `response.cookie()` call gets, so a cookie auth session can
385
396
  * never be weakened to a laxer policy than the framework default.
386
397
  */
387
- type CookieAuthConfig = {
398
+ export type CookieAuthConfig = {
388
399
  /**
389
400
  * Cookie name `setAuthCookie`/`clearAuthCookie` write and clear, and that a
390
401
  * `cookie:<name>` token source must match to read it back.
@@ -400,14 +411,15 @@ type CookieAuthConfig = {
400
411
  * Cookie `Path` attribute.
401
412
  * @default "/"
402
413
  */
403
- path?: string; /** Select a request-scoped Domain; `undefined` keeps the cookie host-only. */
414
+ path?: string;
415
+ /** Select a request-scoped Domain; `undefined` keeps the cookie host-only. */
404
416
  cookieDomain?: CookieDomainResolver;
405
417
  };
406
418
  /**
407
419
  * CSRF Origin-check configuration. Read via
408
420
  * `authConfig.csrf.allowedOrigins()`.
409
421
  */
410
- type CsrfConfig = {
422
+ export type CsrfConfig = {
411
423
  /**
412
424
  * Extra origins allowed on a cookie-authenticated unsafe-method request,
413
425
  * in addition to the request's own origin.
@@ -421,9 +433,12 @@ type CsrfConfig = {
421
433
  * *attribute* flags (`httpOnly`/`sameSite`/`secure`) are never settable here —
422
434
  * see {@link CookieAuthConfig}.
423
435
  */
424
- type SetAuthCookieOptions = {
425
- /** Cookie name; defaults to `auth.cookie.name` (package default `"access_token"`). */name?: string; /** Cookie `Path`; defaults to `auth.cookie.path` (package default `"/"`). */
426
- path?: string; /** Cookie `Domain` attribute. Omit for a host-only cookie. */
436
+ export type SetAuthCookieOptions = {
437
+ /** Cookie name; defaults to `auth.cookie.name` (package default `"access_token"`). */
438
+ name?: string;
439
+ /** Cookie `Path`; defaults to `auth.cookie.path` (package default `"/"`). */
440
+ path?: string;
441
+ /** Cookie `Domain` attribute. Omit for a host-only cookie. */
427
442
  domain?: string;
428
443
  /**
429
444
  * `Max-Age`, in seconds. Overrides the expiry `setAuthCookie` would
@@ -434,10 +449,11 @@ type SetAuthCookieOptions = {
434
449
  maxAge?: number;
435
450
  };
436
451
  /** Per-call overrides for {@link AuthService.clearAuthCookie}. */
437
- type ClearAuthCookieOptions = {
438
- /** Cookie name; defaults to `auth.cookie.name` (package default `"access_token"`). */name?: string; /** Cookie `Path`; defaults to `auth.cookie.path` (package default `"/"`). Must match the `Path` the cookie was set with. */
452
+ export type ClearAuthCookieOptions = {
453
+ /** Cookie name; defaults to `auth.cookie.name` (package default `"access_token"`). */
454
+ name?: string;
455
+ /** Cookie `Path`; defaults to `auth.cookie.path` (package default `"/"`). Must match the `Path` the cookie was set with. */
439
456
  path?: string;
440
457
  };
441
458
  //#endregion
442
- export { AccessTokenConfig, AccessTokenOutput, AuthConfigurations, AuthCredentialDescriptor, AuthCredentials, AuthMiddlewareOptions, AuthNotification, AuthRefreshCredentialDescriptor, CanAuthenticate, ClearAuthCookieOptions, CookieAuthConfig, CookieDomainResolver, CsrfConfig, DeviceInfo, EmailVerificationConfig, LegacyJwtConfig, LoginResult, LogoutWithoutTokenBehavior, NO_EXPIRATION, OneTimeTokenConfig, OneTimeTokenNotificationData, OneTimeTokenUrlBuilder, PageAuthConfig, PasswordResetConfig, PasswordSetter, RefreshTokenConfig, SetAuthCookieOptions, TokenFrom, TokenPair };
443
459
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/contracts/types.ts"],"mappings":";;;;;;;;;;;;;;;AA4BA;;;;AAA0B;AAO1B;;;;AAAsC;AAGtC;;;;cAVa,aAAA;AAab;;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;YAYb;;;;;;EAMV;;;;;;EAMA;;;;;YAMU;;EAEV;;EAEA,WAAW;;EAEX;;;;;;YAOU;EACV,OAAO,IAAI,MAAM,MAAM;;;YAIb,0BAA0B,eAAe,MAAM;;YAG/C,kBAAkB,MAAM,MAAM,iCAAiC;;;;YAK/D;;;;;EAKV;;;;;;EAMA;;EAEA,eAAe;;EAEf,MAAM;;;;;YAMI;;;;;EAKV;;;;;EAKA;;EAEA,eAAe;;EAEf,MAAM;;;;;;;EAON,cAAc;;;;;YAMJ;;EAEV,eAAe;;YAGL;;;;;EAKV;KACG,mBAAmB,WAAW;;;EAGjC;;;;;EAKA,kBAAkB;;;;EAIlB,cAAc;;;;EAId,eAAe;;;;;;EAMf,WAAW;;;;;;EAMX,SAAS;;;;EAIT,OAAO;;;;EAIP,eAAe;;;;EAIf,gBAAgB;;;;EAIhB,eAAe;;;;EAIf,YAAY;;;;EAIZ,WAAW;;;;EAIX,MAAM;;;;EAIN,MAAM;;YAGI;;;;EAIV;;;;EAIA;;;;;YAMU;;;;EAIV,aAAa;;;;EAIb,eAAe;;;;;YAML;;;;EAIV;;;;EAIA;;;;EAIA;;;;;EAKA;;;;EAIA,UAAU;;YAGA,YAAY,iBAAiB;EACvC,MAAM;EACN,QAAQ;;;YAIE,wBAAwB,SAAS;;;;;;;;;YAUjC;;;;;;EAMV;;;;;EAKA;;;;;EAKA;;EAEA,eAAe;;;;;;YAOL;;;;;;EAMV;;;;;;;;YASU;;EAEV;;EAEA;;EAEA;;;;;;;EAOA;;;YAIU;;EAEV;;EAEA"}
@@ -1,5 +1,4 @@
1
1
  import { ServerError } from "@warlock.js/core";
2
-
3
2
  //#region ../../packages/auth/src/errors/auth-provider-sdk-missing.error.d.ts
4
3
  /**
5
4
  * A login method needs a vendor SDK that is an optional peer of
@@ -7,11 +6,10 @@ import { ServerError } from "@warlock.js/core";
7
6
  * the `warlock add` command that installs it; the resolver failure is kept on
8
7
  * `cause`.
9
8
  */
10
- declare class AuthProviderSdkMissingError extends ServerError {
9
+ export declare class AuthProviderSdkMissingError extends ServerError {
11
10
  readonly packageName: string;
12
11
  readonly feature: string;
13
12
  constructor(packageName: string, feature: string, cause?: unknown);
14
13
  }
15
14
  //#endregion
16
- export { AuthProviderSdkMissingError };
17
15
  //# sourceMappingURL=auth-provider-sdk-missing.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-provider-sdk-missing.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/auth-provider-sdk-missing.error.ts"],"mappings":";;;;;AAQA;;;;cAAa,2BAAA,SAAoC,WAAW;EAAA,SAExC,WAAA;EAAA,SACA,OAAA;cADA,WAAA,UACA,OAAA,UAChB,KAAA;AAAA"}
1
+ {"version":3,"file":"auth-provider-sdk-missing.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/auth-provider-sdk-missing.error.ts"],"mappings":";;;;;;;;qBAQa,oCAAoC;WAE7B;WACA;EAFlB,YACkB,qBACA,iBAChB"}
@@ -1,16 +1,14 @@
1
1
  import { AuthErrorCodes } from "../utils/auth-error-codes.mjs";
2
2
  import { ForbiddenError } from "@warlock.js/core";
3
-
4
3
  //#region ../../packages/auth/src/errors/email-not-verified.error.d.ts
5
4
  /**
6
5
  * The authenticated user has not verified their email address. Thrown by
7
6
  * `requireVerifiedEmail()`; core's error handler answers it with `403` and a
8
7
  * `payload.errorCode` of `EC007`.
9
8
  */
10
- declare class EmailNotVerifiedError extends ForbiddenError {
9
+ export declare class EmailNotVerifiedError extends ForbiddenError {
11
10
  readonly code = AuthErrorCodes.EmailNotVerified;
12
11
  constructor(message?: string);
13
12
  }
14
13
  //#endregion
15
- export { EmailNotVerifiedError };
16
14
  //# sourceMappingURL=email-not-verified.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-not-verified.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/email-not-verified.error.ts"],"mappings":";;;;;;AAQA;;;cAAa,qBAAA,SAA8B,cAAc;EAAA,SACvC,IAAA,GAAI,cAAA,CAAA,gBAAA;cAED,OAAA;AAAA"}
1
+ {"version":3,"file":"email-not-verified.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/email-not-verified.error.ts"],"mappings":";;;;;;;;qBAQa,8BAA8B;WACzB,OAAI,eAAA;EAEpB,YAAmB"}
@@ -4,4 +4,5 @@ import { InvalidOneTimeTokenError } from "./invalid-one-time-token.error.mjs";
4
4
  import { InvalidPasskeyError } from "./invalid-passkey.error.mjs";
5
5
  import { InvalidProviderCallbackError } from "./invalid-provider-callback.error.mjs";
6
6
  import { NotificationsUnavailableError } from "./notifications-unavailable.error.mjs";
7
- import { ProviderEmailNotVerifiedError } from "./provider-email-not-verified.error.mjs";
7
+ import { ProviderEmailNotVerifiedError } from "./provider-email-not-verified.error.mjs";
8
+ export { AuthProviderSdkMissingError, EmailNotVerifiedError, InvalidOneTimeTokenError, InvalidPasskeyError, InvalidProviderCallbackError, NotificationsUnavailableError, ProviderEmailNotVerifiedError };
@@ -6,4 +6,4 @@ import { InvalidProviderCallbackError } from "./invalid-provider-callback.error.
6
6
  import { NotificationsUnavailableError } from "./notifications-unavailable.error.mjs";
7
7
  import { ProviderEmailNotVerifiedError } from "./provider-email-not-verified.error.mjs";
8
8
 
9
- export { };
9
+ export { AuthProviderSdkMissingError, EmailNotVerifiedError, InvalidOneTimeTokenError, InvalidPasskeyError, InvalidProviderCallbackError, NotificationsUnavailableError, ProviderEmailNotVerifiedError };
@@ -1,6 +1,5 @@
1
1
  import { AuthErrorCodes } from "../utils/auth-error-codes.mjs";
2
2
  import { BadRequestError } from "@warlock.js/core";
3
-
4
3
  //#region ../../packages/auth/src/errors/invalid-one-time-token.error.d.ts
5
4
  /**
6
5
  * An email-verification or password-reset token was rejected: unknown, issued
@@ -8,10 +7,9 @@ import { BadRequestError } from "@warlock.js/core";
8
7
  * concurrent consumption race). Deliberately ONE error for all of them, so a
9
8
  * caller cannot probe which case applies. Answers `400` with `EC008`.
10
9
  */
11
- declare class InvalidOneTimeTokenError extends BadRequestError {
10
+ export declare class InvalidOneTimeTokenError extends BadRequestError {
12
11
  readonly code = AuthErrorCodes.InvalidOneTimeToken;
13
12
  constructor(message?: string);
14
13
  }
15
14
  //#endregion
16
- export { InvalidOneTimeTokenError };
17
15
  //# sourceMappingURL=invalid-one-time-token.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-one-time-token.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/invalid-one-time-token.error.ts"],"mappings":";;;;;;AASA;;;;cAAa,wBAAA,SAAiC,eAAe;EAAA,SAC3C,IAAA,GAAI,cAAA,CAAA,mBAAA;cAED,OAAA;AAAA"}
1
+ {"version":3,"file":"invalid-one-time-token.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/invalid-one-time-token.error.ts"],"mappings":";;;;;;;;;qBASa,iCAAiC;WAC5B,OAAI,eAAA;EAEpB,YAAmB"}
@@ -1,6 +1,5 @@
1
1
  import { AuthErrorCodes } from "../utils/auth-error-codes.mjs";
2
2
  import { BadRequestError } from "@warlock.js/core";
3
-
4
3
  //#region ../../packages/auth/src/errors/invalid-passkey.error.d.ts
5
4
  /**
6
5
  * A passkey registration or authentication was rejected — unknown, expired
@@ -8,11 +7,10 @@ import { BadRequestError } from "@warlock.js/core";
8
7
  * counter that did not advance. `reason` is for logs; the message stays
9
8
  * generic. Answers `400` with `EC011`.
10
9
  */
11
- declare class InvalidPasskeyError extends BadRequestError {
10
+ export declare class InvalidPasskeyError extends BadRequestError {
12
11
  readonly reason: string;
13
12
  readonly code = AuthErrorCodes.InvalidPasskey;
14
13
  constructor(reason: string, cause?: unknown);
15
14
  }
16
15
  //#endregion
17
- export { InvalidPasskeyError };
18
16
  //# sourceMappingURL=invalid-passkey.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-passkey.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/invalid-passkey.error.ts"],"mappings":";;;;;;AASA;;;;cAAa,mBAAA,SAA4B,eAAe;EAAA,SAIpC,MAAA;EAAA,SAHF,IAAA,GAAI,cAAA,CAAA,cAAA;cAGF,MAAA,UAChB,KAAA;AAAA"}
1
+ {"version":3,"file":"invalid-passkey.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/invalid-passkey.error.ts"],"mappings":";;;;;;;;;qBASa,4BAA4B;WAIrB;WAHF,OAAI,eAAA;EAEpB,YACkB,gBAChB"}
@@ -1,6 +1,5 @@
1
1
  import { AuthErrorCodes } from "../utils/auth-error-codes.mjs";
2
2
  import { BadRequestError } from "@warlock.js/core";
3
-
4
3
  //#region ../../packages/auth/src/errors/invalid-provider-callback.error.d.ts
5
4
  /**
6
5
  * A redirect-provider callback was rejected — missing, forged or expired
@@ -8,11 +7,10 @@ import { BadRequestError } from "@warlock.js/core";
8
7
  * bad signature, issuer, audience, expiry or nonce. `reason` is for logs;
9
8
  * the response message stays generic. Answers `400` with `EC009`.
10
9
  */
11
- declare class InvalidProviderCallbackError extends BadRequestError {
10
+ export declare class InvalidProviderCallbackError extends BadRequestError {
12
11
  readonly reason: string;
13
12
  readonly code = AuthErrorCodes.InvalidProviderCallback;
14
13
  constructor(reason: string, cause?: unknown);
15
14
  }
16
15
  //#endregion
17
- export { InvalidProviderCallbackError };
18
16
  //# sourceMappingURL=invalid-provider-callback.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalid-provider-callback.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/invalid-provider-callback.error.ts"],"mappings":";;;;;;AASA;;;;cAAa,4BAAA,SAAqC,eAAe;EAAA,SAI7C,MAAA;EAAA,SAHF,IAAA,GAAI,cAAA,CAAA,uBAAA;cAGF,MAAA,UAChB,KAAA;AAAA"}
1
+ {"version":3,"file":"invalid-provider-callback.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/invalid-provider-callback.error.ts"],"mappings":";;;;;;;;;qBASa,qCAAqC;WAI9B;WAHF,OAAI,eAAA;EAEpB,YACkB,gBAChB"}
@@ -1,5 +1,4 @@
1
1
  import { ServerError } from "@warlock.js/core";
2
-
3
2
  //#region ../../packages/auth/src/errors/notifications-unavailable.error.d.ts
4
3
  /**
5
4
  * Email verification / password reset could not send its notification because
@@ -7,9 +6,8 @@ import { ServerError } from "@warlock.js/core";
7
6
  * any token is issued — auth never issues a token it cannot deliver, and never
8
7
  * skips the send silently. The original failure is kept on `cause`.
9
8
  */
10
- declare class NotificationsUnavailableError extends ServerError {
9
+ export declare class NotificationsUnavailableError extends ServerError {
11
10
  constructor(reason: "not-installed" | "not-configured", cause?: unknown);
12
11
  }
13
12
  //#endregion
14
- export { NotificationsUnavailableError };
15
13
  //# sourceMappingURL=notifications-unavailable.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-unavailable.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/notifications-unavailable.error.ts"],"mappings":";;;;;AAQA;;;;cAAa,6BAAA,SAAsC,WAAW;cACzC,MAAA,sCAA4C,KAAA;AAAA"}
1
+ {"version":3,"file":"notifications-unavailable.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/notifications-unavailable.error.ts"],"mappings":";;;;;;;;qBAQa,sCAAsC;EACjD,YAAmB,4CAA4C"}
@@ -1,16 +1,14 @@
1
1
  import { AuthErrorCodes } from "../utils/auth-error-codes.mjs";
2
2
  import { ForbiddenError } from "@warlock.js/core";
3
-
4
3
  //#region ../../packages/auth/src/errors/provider-email-not-verified.error.d.ts
5
4
  /**
6
5
  * The provider did not verify the email on a profile with no existing link,
7
6
  * so auth refused to link it to (or create) an account. Answers `403` with
8
7
  * `EC010`.
9
8
  */
10
- declare class ProviderEmailNotVerifiedError extends ForbiddenError {
9
+ export declare class ProviderEmailNotVerifiedError extends ForbiddenError {
11
10
  readonly code = AuthErrorCodes.ProviderEmailNotVerified;
12
11
  constructor(message?: string);
13
12
  }
14
13
  //#endregion
15
- export { ProviderEmailNotVerifiedError };
16
14
  //# sourceMappingURL=provider-email-not-verified.error.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider-email-not-verified.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/provider-email-not-verified.error.ts"],"mappings":";;;;;;AAQA;;;cAAa,6BAAA,SAAsC,cAAc;EAAA,SAC/C,IAAA,GAAI,cAAA,CAAA,wBAAA;cAED,OAAA;AAAA"}
1
+ {"version":3,"file":"provider-email-not-verified.error.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/errors/provider-email-not-verified.error.ts"],"mappings":";;;;;;;;qBAQa,sCAAsC;WACjC,OAAI,eAAA;EAEpB,YAAmB"}
package/esm/index.d.mts CHANGED
@@ -9,6 +9,7 @@ import { AccessTokenConfig, AccessTokenOutput, AuthConfigurations, AuthCredentia
9
9
  import { RefreshToken, RefreshTokenIssueOptions, refreshTokenSchema } from "./models/refresh-token/refresh-token.model.mjs";
10
10
  import { Authenticable } from "./contracts/auth-contract.mjs";
11
11
  import { RequestUser } from "./contracts/request-locals.mjs";
12
+ import "./contracts/index.mjs";
12
13
  import { AuthProviderSdkMissingError } from "./errors/auth-provider-sdk-missing.error.mjs";
13
14
  import { AuthErrorCodes } from "./utils/auth-error-codes.mjs";
14
15
  import { EmailNotVerifiedError } from "./errors/email-not-verified.error.mjs";
@@ -17,6 +18,7 @@ import { InvalidPasskeyError } from "./errors/invalid-passkey.error.mjs";
17
18
  import { InvalidProviderCallbackError } from "./errors/invalid-provider-callback.error.mjs";
18
19
  import { NotificationsUnavailableError } from "./errors/notifications-unavailable.error.mjs";
19
20
  import { ProviderEmailNotVerifiedError } from "./errors/provider-email-not-verified.error.mjs";
21
+ import "./errors/index.mjs";
20
22
  import { AuthErrorTranslations, AuthTranslations } from "./localization/auth-translations.type.mjs";
21
23
  import { authDefaultTranslations } from "./localization/auth-default-translations.mjs";
22
24
  import { registerAuthTranslations } from "./localization/register-auth-translations.mjs";
@@ -26,14 +28,17 @@ import { LoginThrottleIdentifier, LoginThrottleOptions, loginThrottleMiddleware,
26
28
  import { tokenConsumeThrottleMiddleware, tokenIssueThrottleMiddleware } from "./middleware/one-time-token-throttle.middleware.mjs";
27
29
  import { otpRequestThrottleMiddleware, otpVerifyThrottleMiddleware } from "./middleware/otp-throttle.middleware.mjs";
28
30
  import { requireVerifiedEmail } from "./middleware/require-verified-email.middleware.mjs";
31
+ import "./middleware/index.mjs";
29
32
  import { AuthTokenFamily, authTokenFamilySchema } from "./models/auth-token-family/auth-token-family.model.mjs";
30
33
  import { PasskeyCredential, passkeyCredentialSchema } from "./models/passkey-credential/passkey-credential.model.mjs";
31
34
  import { ProviderAccount, providerAccountSchema } from "./models/provider-account/provider-account.model.mjs";
32
35
  import { authMigrations } from "./models/index.mjs";
33
36
  import { requestOtp, verifyOtp } from "./otp/otp.mjs";
37
+ import "./otp/index.mjs";
34
38
  import { PasskeyOptionsJSON, PasskeyResponseJSON } from "./passkeys/simplewebauthn.mjs";
35
39
  import { generatePasskeyAuthenticationOptions, verifyPasskeyAuthentication } from "./passkeys/passkey-authentication.mjs";
36
40
  import { generatePasskeyRegistrationOptions, verifyPasskeyRegistration } from "./passkeys/passkey-registration.mjs";
41
+ import "./passkeys/index.mjs";
37
42
  import { GOOGLE_AUTH_FEATURE, GoogleProvider, JoseModule, pkceChallenge } from "./providers/google-provider.mjs";
38
43
  import { APPLE_AUTH_FEATURE, AppleJoseModule, AppleProvider } from "./providers/apple-provider.mjs";
39
44
  import { DiscordProvider } from "./providers/discord-provider.mjs";
@@ -42,6 +47,7 @@ import { GitHubProvider } from "./providers/github-provider.mjs";
42
47
  import { LINKEDIN_AUTH_FEATURE, LinkedInProvider } from "./providers/linkedin-provider.mjs";
43
48
  import { completeProviderLogin, resolveAuthProvider, startProviderLogin } from "./providers/provider-login.mjs";
44
49
  import { XProvider } from "./providers/x-provider.mjs";
50
+ import "./providers/index.mjs";
45
51
  import { AuthEventCallback, AuthEventName, AuthEventPayloads, authEvents } from "./services/auth-events.mjs";
46
52
  import { CookieDomainRequestRequiredError, authService } from "./services/auth.service.mjs";
47
53
  import { currentUser } from "./services/current-user.mjs";
@@ -51,7 +57,9 @@ import { isEmailVerified, sendEmailVerification, verifyEmail } from "./services/
51
57
  import { IssuedOneTimeToken, consumeOneTimeToken, hashOneTimeToken, issueOneTimeToken, oneTimeTokenModel } from "./services/one-time-tokens.mjs";
52
58
  import { requestPasswordReset, resetPassword } from "./services/password-reset.mjs";
53
59
  import { RequestUserFailure, RequestUserOutcome, ResolveRequestUserOptions, readCredential, resolveRequestUser, resolveRequestUserOutcome } from "./services/resolve-request-user.mjs";
60
+ import "./services/index.mjs";
54
61
  import { PageSessionOptions, PageSessionResolver, SessionMiddlewareOptions, SessionResolverOptions, SessionSource, pageSession, sessionMiddleware } from "./session/page-session.mjs";
62
+ import "./session/index.mjs";
55
63
  import { safeEqual } from "./utils/safe-equal.mjs";
56
64
  import { isNeverExpiring, isUsableExpiry, tokenHasExpClaim } from "./utils/token-expiry.mjs";
57
65
  export { APPLE_AUTH_FEATURE, AUTH_MIDDLEWARE_DESCRIPTOR, AccessToken, AccessTokenConfig, AccessTokenOutput, AppleJoseModule, AppleProvider, AppleProviderConfig, Auth, AuthConfigurations, AuthCredentialDescriptor, AuthCredentials, AuthErrorCodes, AuthErrorTranslations, AuthEventCallback, AuthEventName, AuthEventPayloads, AuthMiddlewareDescriptor, AuthMiddlewareDescriptorSource, AuthMiddlewareOptions, AuthNotification, AuthProvider, AuthProviderSdkMissingError, AuthRefreshCredentialDescriptor, AuthTokenFamily, AuthTranslations, Authenticable, CanAuthenticate, ClearAuthCookieOptions, CookieAuthConfig, CookieDomainRequestRequiredError, CookieDomainResolver, CsrfConfig, CsrfOriginMismatchError, CsrfOriginMismatchReason, DeviceInfo, DiscordProvider, DiscordProviderConfig, EmailNotVerifiedError, EmailVerificationConfig, FacebookProvider, FacebookProviderConfig, GOOGLE_AUTH_FEATURE, GitHubProvider, GitHubProviderConfig, GoogleProvider, GoogleProviderConfig, InvalidOneTimeTokenError, InvalidPasskeyError, InvalidProviderCallbackError, IssuedOneTimeToken, JoseModule, LINKEDIN_AUTH_FEATURE, LegacyJwtConfig, LinkedInProvider, LinkedInProviderConfig, LoginResult, LoginThrottleIdentifier, LoginThrottleOptions, LogoutWithoutTokenBehavior, NO_EXPIRATION, NotificationsUnavailableError, OneTimeToken, OneTimeTokenConfig, OneTimeTokenNotificationData, OneTimeTokenPurpose, OneTimeTokenUrlBuilder, OtpConfig, OtpMessage, OtpSender, PageAuthConfig, PageSessionOptions, PageSessionResolver, PasskeyCredential, type PasskeyOptionsJSON, type PasskeyResponseJSON, PasskeysConfig, PasswordResetConfig, PasswordSetter, ProviderAccount, ProviderAuthorizationState, ProviderCallbackParams, ProviderEmailNotVerifiedError, ProviderProfile, ProviderUserCreator, ProvidersConfig, RefreshToken, RefreshTokenConfig, RefreshTokenIssueOptions, RequestUser, RequestUserFailure, RequestUserOutcome, ResolveRequestUserOptions, SessionMiddlewareOptions, SessionResolverOptions, SessionSource, SetAuthCookieOptions, TokenFrom, TokenPair, TokenType, TokenTypeError, XProvider, XProviderConfig, accessTokenSchema, assertCsrfOriginAllowed, authDefaultTranslations, authEvents, authMiddleware, authMigrations, authService, authTokenFamilySchema, completeProviderLogin, consumeOneTimeToken, currentUser, generateJWTSecret, generatePasskeyAuthenticationOptions, generatePasskeyRegistrationOptions, hashOneTimeToken, isEmailVerified, isInvalidCredentialError, isNeverExpiring, isUsableExpiry, issueOneTimeToken, jwt, loginThrottleMiddleware, oneTimeTokenModel, oneTimeTokenSchema, otpRequestThrottleMiddleware, otpVerifyThrottleMiddleware, pageSession, passkeyCredentialSchema, pkceChallenge, providerAccountSchema, readCredential, refreshTokenSchema, registerAuthCleanupCommand, registerAuthPurgeNeverExpiringCommand, registerAuthTranslations, registerJWTSecretGeneratorCommand, requestOtp, requestPasswordReset, requireVerifiedEmail, requiresCsrfOriginCheck, resetPassword, resolveAuthProvider, resolveRequestUser, resolveRequestUserOutcome, safeEqual, sendEmailVerification, sessionMiddleware, startProviderLogin, throttleIdentifierHash, tokenConsumeThrottleMiddleware, tokenHasExpClaim, tokenIssueThrottleMiddleware, verifyEmail, verifyOtp, verifyPasskeyAuthentication, verifyPasskeyRegistration };
@@ -1,10 +1,8 @@
1
1
  import { AuthTranslations } from "./auth-translations.type.mjs";
2
-
3
2
  //#region ../../packages/auth/src/localization/auth-default-translations.d.ts
4
3
  /**
5
4
  * Every locale auth ships default text for, keyed by locale code.
6
5
  */
7
- declare const authDefaultTranslations: Record<string, AuthTranslations>;
6
+ export declare const authDefaultTranslations: Record<string, AuthTranslations>;
8
7
  //#endregion
9
- export { authDefaultTranslations };
10
8
  //# sourceMappingURL=auth-default-translations.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-default-translations.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/localization/auth-default-translations.ts"],"mappings":";;;;;AAOA;cAAa,uBAAA,EAAyB,MAAM,SAAS,gBAAA"}
1
+ {"version":3,"file":"auth-default-translations.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/localization/auth-default-translations.ts"],"mappings":";;;;;qBAOa,yBAAyB,eAAe"}
@@ -6,22 +6,26 @@
6
6
  * one — translating a new `auth.errors.*` key means adding it here, and the
7
7
  * compiler then demands a string in each built-in locale.
8
8
  */
9
- type AuthErrorTranslations = {
10
- /** 401 — no credential was sent. */missingAccessToken: string; /** 401 — the credential is malformed, expired, or revoked. */
11
- invalidAccessToken: string; /** 401 — the credential is valid but its user type is not allowed here. */
12
- unauthorized: string; /** 403 — a cookie-authenticated unsafe request came from a foreign origin. */
13
- csrfOriginMismatch: string; /** 429 — login throttle lockout. */
9
+ export type AuthErrorTranslations = {
10
+ /** 401 — no credential was sent. */
11
+ missingAccessToken: string;
12
+ /** 401 — the credential is malformed, expired, or revoked. */
13
+ invalidAccessToken: string;
14
+ /** 401 — the credential is valid but its user type is not allowed here. */
15
+ unauthorized: string;
16
+ /** 403 — a cookie-authenticated unsafe request came from a foreign origin. */
17
+ csrfOriginMismatch: string;
18
+ /** 429 — login throttle lockout. */
14
19
  tooManyAttempts: string;
15
20
  };
16
21
  /**
17
22
  * One locale's worth of auth translations, shaped as the keyword tree
18
23
  * `@mongez/localization`'s `extend(localeCode, keywords)` accepts.
19
24
  */
20
- type AuthTranslations = {
25
+ export type AuthTranslations = {
21
26
  auth: {
22
27
  errors: AuthErrorTranslations;
23
28
  };
24
29
  };
25
30
  //#endregion
26
- export { AuthErrorTranslations, AuthTranslations };
27
31
  //# sourceMappingURL=auth-translations.type.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-translations.type.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/localization/auth-translations.type.ts"],"mappings":";;AAOA;;;;;;KAAY,qBAAA;EAQV,oCANA,kBAAA,UAQe;EANf,kBAAA,UAaU;EAXV,YAAA;EAEA,kBAAA,UAUA;EARA,eAAA;AAAA;;AAS+B;;;KAFrB,gBAAA;EACV,IAAA;IACE,MAAA,EAAQ,qBAAqB;EAAA;AAAA"}
1
+ {"version":3,"file":"auth-translations.type.d.mts","names":[],"sources":["../../../../../../../../packages/auth/src/localization/auth-translations.type.ts"],"mappings":";;;;;;;;YAOY;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;YAOU;EACV;IACE,QAAQ"}
@@ -1,4 +1,4 @@
1
1
  import { authDefaultTranslations } from "./auth-default-translations.mjs";
2
2
  import { registerAuthTranslations } from "./register-auth-translations.mjs";
3
3
 
4
- export { };
4
+ export { authDefaultTranslations, registerAuthTranslations };
@@ -11,7 +11,6 @@
11
11
  *
12
12
  * Runs once at import of `@warlock.js/auth`; safe to call again.
13
13
  */
14
- declare function registerAuthTranslations(): void;
14
+ export declare function registerAuthTranslations(): void;
15
15
  //#endregion
16
- export { registerAuthTranslations };
17
16
  //# sourceMappingURL=register-auth-translations.d.mts.map