From 4a229ab798cc9fdcc7309efdea7dc73d9e1367a7 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 14:50:40 +0000 Subject: [PATCH 1/4] wip(plugin-auth): reset link refused as duplicate answers the uniform reset answer Paused by the maintainer (p3 work paused); WIP pushed on his order. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6CYxMdMFNAPYqMHvqBt --- .../32645-reset-duplicate-uniform-answer.md | 14 ++ .../plugin-auth/src/objectql-adapter.ts | 6 +- .../reset-request-duplicate-refusal.test.ts | 163 ++++++++++++++++++ .../src/reset-request-duplicate-refusal.ts | 74 ++++++++ 4 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 .changeset/32645-reset-duplicate-uniform-answer.md create mode 100644 packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts create mode 100644 packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts diff --git a/.changeset/32645-reset-duplicate-uniform-answer.md b/.changeset/32645-reset-duplicate-uniform-answer.md new file mode 100644 index 00000000000..e99659d3db2 --- /dev/null +++ b/.changeset/32645-reset-duplicate-uniform-answer.md @@ -0,0 +1,14 @@ +--- +'@objectstack/plugin-auth': patch +--- + +fix(plugin-auth): a password-reset request whose link the database refuses as a duplicate answers the uniform reset answer, not an empty 500 + +Clause-②: no +Metadata-protocol: none + +Who sees it: anyone who asks for a password-reset link more than once on a deployment whose `sys_verification` table still carries the UNIQUE index on `value` that #11701 retired (a database created before it that schema sync never dropped it from). + +- **Before:** the second live reset link of one user was refused by that index, and `POST /request-password-reset` answered a 500 with an empty body. The forgot-password page showed "Auth request failed with status 500". +- **Now:** the refused request answers the same `200` and the same body every reset request gets ("If this email exists in our system, check your email for the reset link"), and no mail is sent for it. The link the earlier request sent still works. The server logs one warning naming the leftover index as the usual cause. +- Only the reset link's row reads the duplicate refusal this way. Every other write keeps the refusal it had. A conflict status here would answer an address with an account differently from one without, so this door does not get one. diff --git a/packages/plugins/plugin-auth/src/objectql-adapter.ts b/packages/plugins/plugin-auth/src/objectql-adapter.ts index 035b429e75d..ce0fa1c75ef 100644 --- a/packages/plugins/plugin-auth/src/objectql-adapter.ts +++ b/packages/plugins/plugin-auth/src/objectql-adapter.ts @@ -32,6 +32,7 @@ import { } from './internal-field-readback.js'; import { decodeOrganizationMetadataOnRead } from './organization-metadata-decode.js'; import { endResetTokensOnCredentialWrite, type ResetTokenCache } from './credential-change-ends-reset-tokens.js'; +import { insertOrVetoResetLink } from './reset-request-duplicate-refusal.js'; /** * Mapping from better-auth model names to ObjectStack protocol object names. @@ -971,7 +972,10 @@ export function createObjectQLAdapterFactory( // other reset tokens first (`credential-change-ends-reset-tokens.ts`). await endResetTokens(objectName, row, [row]); const adopted = await adoptExistingMembership(dataEngine as any, objectName, row); - const result = adopted ?? (await dataEngine.insert(objectName, row)); + // A reset link's row refused as a duplicate is a veto, not a 500 + // (`reset-request-duplicate-refusal.ts`). + const result = adopted ?? (await insertOrVetoResetLink(objectName, row, () => dataEngine.insert(objectName, row))); + if (result === null) return null as unknown as T; if (factoryOptions.onRecordCreated && result && typeof result === 'object') { try { await factoryOptions.onRecordCreated(objectName, result as Record); diff --git a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts new file mode 100644 index 00000000000..d2acd473486 --- /dev/null +++ b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts @@ -0,0 +1,163 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * #32645 — a reset request whose link row the store refuses as a duplicate + * answers the uniform reset answer, never an empty 500. + * + * The store here is the one production carried: `sys_verification` with a + * leftover UNIQUE index on `value` (#11701 retired it from metadata; a + * database created before that kept it). better-auth writes the user's id + * into `value` for every reset link, so the second live link of one user is + * refused by the store. + */ + +import { describe, it, expect, afterEach, afterAll, vi } from 'vitest'; +import { ObjectQL } from '@objectstack/objectql'; +import { SqlDriver } from '@objectstack/driver-sql'; +import { SystemObjectName } from '@objectstack/spec/system'; +import { AuthManager } from './auth-manager.js'; +import { authIdentityObjects } from './manifest.js'; +import { insertOrVetoResetLink, isDuplicateRefusal, isResetLinkRow } from './reset-request-duplicate-refusal.js'; +import { memoizeScrypt } from './__tests__/scrypt-memo.testkit'; +import 'better-auth'; +import 'better-auth/api'; +import 'better-auth/plugins'; + +const BASE = 'http://localhost:3000'; +const AUTH = `${BASE}/api/v1/auth`; +const SECRET = 'test-secret-at-least-32-chars-long-reset-duplicate'; +const EMAIL = 'reset-duplicate@example.com'; +const NOBODY = 'no-account-reset-duplicate@example.com'; +const PASSWORD = 'Reset!Duplicate-Refusal-2026'; + +const scrypt = memoizeScrypt(); +afterAll(scrypt.restore); + +const drivers: SqlDriver[] = []; +afterEach(async () => { + vi.restoreAllMocks(); + await Promise.all(drivers.splice(0).map((d) => d.disconnect?.())); +}); + +/** The identity objects, with `sys_verification.value` carrying the retired UNIQUE index. */ +function objectsWithLeftoverUniqueValue() { + return authIdentityObjects.map((object) => + object?.name === SystemObjectName.VERIFICATION + ? { ...object, indexes: [...(object.indexes ?? []), { fields: ['value'], unique: true }] } + : object, + ); +} + +const post = (manager: AuthManager, path: string, body: unknown) => + manager.handleRequest( + new Request(`${AUTH}${path}`, { + method: 'POST', + headers: { 'Content-Type': 'application/json', origin: BASE }, + body: JSON.stringify(body), + }), + ); + +type Mail = { template: string; to: { address: string } }; + +async function deployment() { + vi.spyOn(console, 'warn').mockImplementation(() => {}); + const consoleErrors = vi.spyOn(console, 'error').mockImplementation(() => {}); + const engine = new ObjectQL(); + const driver = new SqlDriver({ + client: 'better-sqlite3', + connection: { filename: ':memory:' }, + useNullAsDefault: true, + }); + drivers.push(driver); + engine.registerDriver(driver, true); + await engine.init(); + for (const object of objectsWithLeftoverUniqueValue()) { + engine.registry.registerObject(object as never, '@objectstack/plugin-auth'); + } + await engine.syncSchemas(); + const logged: string[] = []; + const manager = new AuthManager({ + secret: SECRET, + baseUrl: BASE, + dataEngine: engine as never, + logger: { warn: () => {}, error: (message: string) => logged.push(message) }, + } as never); + const sends: Mail[] = []; + manager.setEmailService({ + sendTemplate: async (input: Mail) => { + sends.push(input); + return { status: 'sent' }; + }, + } as never); + const signedUp = await post(manager, '/sign-up/email', { email: EMAIL, password: PASSWORD, name: 'Reset' }); + expect(signedUp.status, await signedUp.clone().text()).toBe(200); + sends.length = 0; + consoleErrors.mockClear(); + return { engine, manager, sends, logged, consoleErrors }; +} + +async function requestReset(manager: AuthManager, email: string) { + const res = await post(manager, '/request-password-reset', { email, redirectTo: `${BASE}/reset` }); + return { status: res.status, body: await res.text() }; +} + +describe('a reset link the store refuses as a duplicate answers the uniform reset answer (#32645)', () => { + it('a second reset request for one account answers 200 with the uniform body, sends no second mail, logs no error', async () => { + const d = await deployment(); + + const first = await requestReset(d.manager, EMAIL); + const second = await requestReset(d.manager, EMAIL); + + expect(first.status, first.body).toBe(200); + expect(second.status, second.body).toBe(200); + expect(second.body).toBe(first.body); + expect(JSON.parse(second.body)).toEqual({ status: true, message: expect.any(String) }); + await vi.waitFor(() => expect(d.sends.map((m) => [m.template, m.to.address])).toEqual([ + ['auth.password_reset', EMAIL], + ])); + expect(d.logged).toEqual([]); + expect(d.consoleErrors).not.toHaveBeenCalled(); + }, 60_000); + + it('answers a refused account the same as an address with no account', async () => { + const d = await deployment(); + await requestReset(d.manager, EMAIL); + + const refused = await requestReset(d.manager, EMAIL); + const nobody = await requestReset(d.manager, NOBODY); + + expect(refused).toEqual(nobody); + await vi.waitFor(() => expect(d.sends).toHaveLength(1)); + }, 60_000); +}); + +describe('insertOrVetoResetLink', () => { + const duplicate = Object.assign(new Error('already holds this value'), { code: 'DUPLICATE_RECORD', status: 409 }); + const resetRow = { identifier: 'reset-password:abc', value: 'user-1' }; + + it('answers null for a reset link row refused as a duplicate', async () => { + vi.spyOn(console, 'warn').mockImplementation(() => {}); + await expect(insertOrVetoResetLink(SystemObjectName.VERIFICATION, resetRow, async () => { throw duplicate; })).resolves.toBeNull(); + }); + + it('rethrows a duplicate refusal of any other verification row', async () => { + const other = { identifier: 'email-verification:abc', value: 'user-1' }; + await expect(insertOrVetoResetLink(SystemObjectName.VERIFICATION, other, async () => { throw duplicate; })).rejects.toBe(duplicate); + }); + + it('rethrows a duplicate refusal of another object', async () => { + await expect(insertOrVetoResetLink(SystemObjectName.USER, resetRow, async () => { throw duplicate; })).rejects.toBe(duplicate); + }); + + it('rethrows any other refusal of a reset link row', async () => { + const other = Object.assign(new Error('boom'), { code: 'SERVICE_UNAVAILABLE' }); + await expect(insertOrVetoResetLink(SystemObjectName.VERIFICATION, resetRow, async () => { throw other; })).rejects.toBe(other); + }); + + it('reads a raw driver unique violation as a duplicate refusal', () => { + expect(isDuplicateRefusal({ code: 'SQLITE_CONSTRAINT_UNIQUE' })).toBe(true); + expect(isDuplicateRefusal({ code: '23505' })).toBe(true); + expect(isDuplicateRefusal(new Error('boom'))).toBe(false); + expect(isResetLinkRow(SystemObjectName.VERIFICATION, { identifier: 'reset-password:x' })).toBe(true); + }); +}); diff --git a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts new file mode 100644 index 00000000000..e4b5e36ad46 --- /dev/null +++ b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts @@ -0,0 +1,74 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * A reset link whose row the store refuses as a duplicate answers the uniform + * reset answer, not an empty 500. + * + * ## The defect (#32645) + * + * `POST /request-password-reset` writes one `sys_verification` row per link: + * identifier `reset-password:TOKEN`, value the user's id. A store that still + * carries a unique index on `value` — a database created before #11701 that + * schema sync never dropped it from — refuses the second live link of one + * user. The engine throws `DuplicateRecordError` (`DUPLICATE_RECORD`, 409), + * which `rethrowAsBetterAuthError` does not map, so better-auth's router + * answered it as a 500 with an empty body and the forgot-password page showed + * the client fallback "Auth request failed with status 500". + * + * ## The answer + * + * Only that write is affected. Its duplicate refusal is read as a veto: the + * adapter returns `null`, and better-auth 1.7.x's reset handler answers a + * veto (`createVerificationValue` → falsy) with the same uniform body it + * gives a sent link and an unknown address (`status: true` + "If this email + * exists…"). No mail goes out for the refused request; the link the earlier + * request sent still works. + * + * ⛔ Not a generic 409. A conflict status on this door would answer a real + * account differently from an unknown address — an account-existence oracle + * the uniform answer exists to close. Every other write keeps the refusal it + * had. + */ + +import { SystemObjectName } from '@objectstack/spec/system'; +import { isUniqueViolationError } from '@objectstack/types'; +import { RESET_LINK_IDENTIFIER_PREFIX } from './credential-change-ends-reset-tokens.js'; + +/** The engine's code for a unique refusal (`@objectstack/objectql` `DuplicateRecordError`). */ +const DUPLICATE_RECORD_CODE = 'DUPLICATE_RECORD'; + +/** True for the row of an emailed reset link (identifier `reset-password:TOKEN`). */ +export function isResetLinkRow(objectName: string, row: unknown): boolean { + if (objectName !== SystemObjectName.VERIFICATION || !row || typeof row !== 'object') return false; + const identifier = (row as { identifier?: unknown }).identifier; + return typeof identifier === 'string' && identifier.startsWith(RESET_LINK_IDENTIFIER_PREFIX); +} + +/** True for the engine's duplicate refusal, or a raw driver unique violation. */ +export function isDuplicateRefusal(err: unknown): boolean { + if (err && typeof err === 'object' && (err as { code?: unknown }).code === DUPLICATE_RECORD_CODE) return true; + return isUniqueViolationError(err); +} + +/** + * Run `insert` for `row`. When `row` is a reset link's and the store refuses + * it as a duplicate, answer `null` (better-auth's veto) instead of throwing; + * any other row or refusal throws as before. + */ +export async function insertOrVetoResetLink( + objectName: string, + row: unknown, + insert: () => Promise, +): Promise { + try { + return await insert(); + } catch (err) { + if (!isResetLinkRow(objectName, row) || !isDuplicateRefusal(err)) throw err; + console.warn( + '[auth] a password-reset link was not issued: the verification store refused its row as a duplicate. ' + + 'The request answers the uniform reset answer and no mail is sent. A unique index on ' + + `${SystemObjectName.VERIFICATION}.value is the usual cause; the platform declares none there (#11701).`, + ); + return null; + } +} From fc0585007e0d5a3937485bc6558cc71ba443ca07 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 01:22:42 +0000 Subject: [PATCH 2/4] fix(plugin-auth): pin the duplicate reset answer against first and unknown, add a burst pin The refused reset request answers exactly what a first request and an unknown address answer (status, media type, body), proven against a store that really refused the row; five concurrent requests answer the same and log no error. The runtime warning names its remedy instead of a tracker number, and the module header names the two doors this seam leaves alone (host secondaryStorage, the phone reset door) and why. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj --- .../32645-reset-duplicate-uniform-answer.md | 2 +- .../reset-request-duplicate-refusal.test.ts | 27 ++++++++++++++++--- .../src/reset-request-duplicate-refusal.ts | 18 ++++++++++++- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/.changeset/32645-reset-duplicate-uniform-answer.md b/.changeset/32645-reset-duplicate-uniform-answer.md index e99659d3db2..baba71b601e 100644 --- a/.changeset/32645-reset-duplicate-uniform-answer.md +++ b/.changeset/32645-reset-duplicate-uniform-answer.md @@ -10,5 +10,5 @@ Metadata-protocol: none Who sees it: anyone who asks for a password-reset link more than once on a deployment whose `sys_verification` table still carries the UNIQUE index on `value` that #11701 retired (a database created before it that schema sync never dropped it from). - **Before:** the second live reset link of one user was refused by that index, and `POST /request-password-reset` answered a 500 with an empty body. The forgot-password page showed "Auth request failed with status 500". -- **Now:** the refused request answers the same `200` and the same body every reset request gets ("If this email exists in our system, check your email for the reset link"), and no mail is sent for it. The link the earlier request sent still works. The server logs one warning naming the leftover index as the usual cause. +- **Now:** the refused request answers the same `200` and the same body every reset request gets ("If this email exists in our system, check your email for the reset link"), and no mail is sent for it (on a deployment with a host `secondaryStorage`, the link is kept in that cache only and is mailed). The link the earlier request sent still works. The server logs one warning naming the leftover index as the usual cause. - Only the reset link's row reads the duplicate refusal this way. Every other write keeps the refusal it had. A conflict status here would answer an address with an account differently from one without, so this door does not get one. diff --git a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts index d2acd473486..195cfed2319 100644 --- a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts +++ b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts @@ -96,9 +96,10 @@ async function deployment() { return { engine, manager, sends, logged, consoleErrors }; } +/** What a caller of the door can observe: status, media type and body. */ async function requestReset(manager: AuthManager, email: string) { const res = await post(manager, '/request-password-reset', { email, redirectTo: `${BASE}/reset` }); - return { status: res.status, body: await res.text() }; + return { status: res.status, contentType: res.headers.get('content-type'), body: await res.text() }; } describe('a reset link the store refuses as a duplicate answers the uniform reset answer (#32645)', () => { @@ -119,16 +120,36 @@ describe('a reset link the store refuses as a duplicate answers the uniform rese expect(d.consoleErrors).not.toHaveBeenCalled(); }, 60_000); - it('answers a refused account the same as an address with no account', async () => { + it('answers a refused account exactly as a first request and an address with no account (no existence oracle)', async () => { const d = await deployment(); - await requestReset(d.manager, EMAIL); + const first = await requestReset(d.manager, EMAIL); const refused = await requestReset(d.manager, EMAIL); const nobody = await requestReset(d.manager, NOBODY); + // The refusal really happened: the store holds one link row, not two. + const rows = await d.engine.find(SystemObjectName.VERIFICATION); + expect((rows as Array<{ identifier: string }>).filter((r) => r.identifier.startsWith('reset-password:'))).toHaveLength(1); + + expect(first.status).toBe(200); + expect(refused).toEqual(first); expect(refused).toEqual(nobody); await vi.waitFor(() => expect(d.sends).toHaveLength(1)); }, 60_000); + + it('a burst of five concurrent requests for one account answers the uniform 200 every time and logs no error', async () => { + const d = await deployment(); + const nobody = await requestReset(d.manager, NOBODY); + + const burst = await Promise.all(Array.from({ length: 5 }, () => requestReset(d.manager, EMAIL))); + + for (const answer of burst) expect(answer).toEqual(nobody); + expect(nobody.status).toBe(200); + // The index admits one live link per user: one row, one mail. + await vi.waitFor(() => expect(d.sends).toHaveLength(1)); + expect(d.logged).toEqual([]); + expect(d.consoleErrors).not.toHaveBeenCalled(); + }, 60_000); }); describe('insertOrVetoResetLink', () => { diff --git a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts index e4b5e36ad46..5bf931e0dfa 100644 --- a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts +++ b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.ts @@ -28,6 +28,22 @@ * account differently from an unknown address — an account-existence oracle * the uniform answer exists to close. Every other write keeps the refusal it * had. + * + * ## What this seam does not cover, and why it need not + * + * - **A host `secondaryStorage`** (`storeInDatabase: true`, see + * `auth-manager-auth-instance.ts`): better-auth still writes the cache copy + * of a vetoed row and treats it as created, so the request mails a link + * that lives in the cache only. The answer is the same uniform `200`, so the + * door still says nothing about the account; only the row is missing. + * - **The phone reset door** (`/phone-number/request-password-reset`) writes + * `phone-number-reset-PHONE` rows whose `value` is a random code, deletes + * the phone's earlier row first, and writes for unknown numbers too — so a + * repeat does not collide on `value`, and a concurrent pair colliding on the + * row's derived id is already recovered by better-auth's + * `createOrFindVerification` (it reads the driver error the engine keeps as + * `cause`). Its identifier does not carry `reset-password:`, so this seam + * leaves it untouched. */ import { SystemObjectName } from '@objectstack/spec/system'; @@ -67,7 +83,7 @@ export async function insertOrVetoResetLink( console.warn( '[auth] a password-reset link was not issued: the verification store refused its row as a duplicate. ' + 'The request answers the uniform reset answer and no mail is sent. A unique index on ' - + `${SystemObjectName.VERIFICATION}.value is the usual cause; the platform declares none there (#11701).`, + + `${SystemObjectName.VERIFICATION}.value left by an older schema is the usual cause: the platform declares no index there, so drop it.`, ); return null; } From 44a8f346212717713a3c0170c7110b12eb927bdd Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 02:10:40 +0000 Subject: [PATCH 3/4] test(plugin-auth): count the refused link row off the table, not the engine read The engine strips `identifier` on read, so the one-row proof reads the sys_verification table itself. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj --- .../src/reset-request-duplicate-refusal.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts index 195cfed2319..543acbb5141 100644 --- a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts +++ b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts @@ -93,7 +93,7 @@ async function deployment() { expect(signedUp.status, await signedUp.clone().text()).toBe(200); sends.length = 0; consoleErrors.mockClear(); - return { engine, manager, sends, logged, consoleErrors }; + return { engine, driver, manager, sends, logged, consoleErrors }; } /** What a caller of the door can observe: status, media type and body. */ @@ -127,9 +127,10 @@ describe('a reset link the store refuses as a duplicate answers the uniform rese const refused = await requestReset(d.manager, EMAIL); const nobody = await requestReset(d.manager, NOBODY); - // The refusal really happened: the store holds one link row, not two. - const rows = await d.engine.find(SystemObjectName.VERIFICATION); - expect((rows as Array<{ identifier: string }>).filter((r) => r.identifier.startsWith('reset-password:'))).toHaveLength(1); + // The refusal really happened: the store holds one link row, not two + // (read off the table itself; the engine strips `identifier` on read). + const linkRows = await d.driver.getKnex()(SystemObjectName.VERIFICATION).where('identifier', 'like', 'reset-password:%'); + expect(linkRows).toHaveLength(1); expect(first.status).toBe(200); expect(refused).toEqual(first); From 07975ef04183c94469c52cd0fcbdd270ab68fcaf Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 02:53:11 +0000 Subject: [PATCH 4/4] test(plugin-auth): load the egress module at collection in the reset duplicate pins `check:test-source-alias` finds the reach into a dynamic `@objectstack/core/egress` import; pay it at module top, not inside a clocked case. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_016WV4cwiNRyb9B38wT2fjYj --- .../plugin-auth/src/reset-request-duplicate-refusal.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts index 543acbb5141..34a24794bd5 100644 --- a/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts +++ b/packages/plugins/plugin-auth/src/reset-request-duplicate-refusal.test.ts @@ -22,6 +22,8 @@ import { memoizeScrypt } from './__tests__/scrypt-memo.testkit'; import 'better-auth'; import 'better-auth/api'; import 'better-auth/plugins'; +// Paid at collection, not inside a clocked case (`check:test-source-alias`). +import '@objectstack/core/egress'; const BASE = 'http://localhost:3000'; const AUTH = `${BASE}/api/v1/auth`;