fixed login route and updated file name

This commit is contained in:
ImAlpha 2023-12-08 21:09:19 -08:00
parent d15ff5b03e
commit 988a24e208

View File

@ -5,10 +5,10 @@ import { DrizzleAdapter } from "@auth/drizzle-adapter";
import { db, connection } from "@/db/db"; import { db, connection } from "@/db/db";
import { users } from "@/db/schema"; import { users } from "@/db/schema";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
import isValidCredentials from "zod";
const handler = NextAuth({ const handler = NextAuth({
adapter: DrizzleAdapter(db), // adapter: DrizzleAdapter(db),
session: { session: {
strategy: "jwt", strategy: "jwt",
}, },
@ -43,7 +43,10 @@ const handler = NextAuth({
console.log({ passwordCheck }); console.log({ passwordCheck });
if (passwordCheck) { if (passwordCheck) {
return response[0]; return {
id: response[0].id,
email: response[0].email,
};
} }
return null; return null;
}, },