diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts index e23c689..06af25e 100644 --- a/src/app/api/auth/[...nextauth]/route.ts +++ b/src/app/api/auth/[...nextauth]/route.ts @@ -36,7 +36,6 @@ export const AuthOptions: NextAuthOptions = { if (user === null || user.email === null) { return "/beta"; } - const dbUser: User[] = await db .select() .from(userTable) @@ -65,8 +64,8 @@ export const AuthOptions: NextAuthOptions = { } // Set the user's ID from your database - user.dbId = dbUser[0].id; - + // Because bigint isn't serializable, we need to convert it to a string + user.dbId = dbUser[0].id.toString(); return true; } catch (error) { console.error("Error during sign-in: ", error); diff --git a/src/types/next-auth.d.ts b/src/types/next-auth.d.ts index e70ea32..31c6bd6 100644 --- a/src/types/next-auth.d.ts +++ b/src/types/next-auth.d.ts @@ -9,6 +9,6 @@ declare module "next-auth" { } & DefaultSession["user"]; } interface User { - dbId: bigint; + dbId: string; } }