Skip to content

Commit f812a10

Browse files
committed
fix(auth): guard db.batch in ensureDefaultUserAndSession for mock D1 E2E tests
1 parent a75c3fa commit f812a10

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/site/src/lib/auth.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export async function hashToken(token: string): Promise<string> {
5353
* and the default MCP explorer user exist in Cloudflare D1.
5454
*/
5555
export async function ensureDefaultUserAndSession(db: D1Database) {
56+
if (typeof db.batch !== "function") {
57+
return;
58+
}
5659
const now = Date.now();
5760
await db.batch([
5861
db.prepare(

0 commit comments

Comments
 (0)