From 8186bd773116f3712ac127703a89b94e1ab26d5d Mon Sep 17 00:00:00 2001 From: Leon Serfaty G Date: Mon, 1 Sep 2025 07:05:09 +0000 Subject: [PATCH] cant login... error --- src/auth.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/auth.ts b/src/auth.ts index bfa7472..4822173 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -28,7 +28,11 @@ export const { handlers, auth, signIn, signOut } = NextAuth({ // In a real application, you MUST hash and salt passwords. const passwordsMatch = password === user.password; - if (passwordsMatch) return user; + if (passwordsMatch) { + // The user object returned here will be encoded in the JWT. + return { id: user.id, name: user.name, email: user.email }; + } + } catch (e) { console.error(e) return null