From 68a5c270a66f07378cd9ac71e21a5c685956fd64 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 8 May 2025 15:36:11 +0100 Subject: [PATCH] fix: init auth for auth api route --- apps/web/src/pages/api/auth/[...all].ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/pages/api/auth/[...all].ts b/apps/web/src/pages/api/auth/[...all].ts index dd677d59..e384c9c2 100644 --- a/apps/web/src/pages/api/auth/[...all].ts +++ b/apps/web/src/pages/api/auth/[...all].ts @@ -1,8 +1,12 @@ import { toNodeHandler } from "better-auth/node"; -import { auth } from "@kan/auth"; +import { initAuth } from "@kan/auth"; +import { createDrizzleClient } from "@kan/db/client"; export const config = { api: { bodyParser: false } }; + +const auth = initAuth(createDrizzleClient()); + export default toNodeHandler(auth.handler); // export const runtime = "edge";