Having an issue when using Nextauth for signing in getting `Invalid Compact JWE`

So i have adjusted my User interface and what Nextauth session return. this is my new interfaces:
declare module "next-auth" {
interface Session {
user: {
id: string;
bio: string;
userName: string;
theme: TTheme;
font: TFont;
email: string;
} & DefaultSession["user"];
}
interface User extends DbUser {}
}
declare module "next-auth" {
interface Session {
user: {
id: string;
bio: string;
userName: string;
theme: TTheme;
font: TFont;
email: string;
} & DefaultSession["user"];
}
interface User extends DbUser {}
}
since then i seem to be getting this error:
[next-auth][error][JWT_SESSION_ERROR]
https://next-auth.js.org/errors#jwt_session_error Invalid Compact JWE {
message: 'Invalid Compact JWE',
stack: 'JWEInvalid: Invalid Compact JWE\n' +
' at compactDecrypt (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:15)\n' +
' at jwtDecrypt (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/cjs/jwt/decrypt.js:10:61)\n' +
' at Object.decode (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/jwt/index.js:44:52)\n' +
' at async Object.session (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/core/routes/session.js:25:34)\n' +
' at async AuthHandler (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/core/index.js:161:37)\n' +
' at async getServerSession (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/next/index.js:126:21)\n' +
' at async RootLayout (webpack-internal:///(rsc)/./src/app/layout.tsx:100:21)',
name: 'JWEInvalid'
}
[next-auth][error][JWT_SESSION_ERROR]
https://next-auth.js.org/errors#jwt_session_error Invalid Compact JWE {
message: 'Invalid Compact JWE',
stack: 'JWEInvalid: Invalid Compact JWE\n' +
' at compactDecrypt (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:15)\n' +
' at jwtDecrypt (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected]/node_modules/jose/dist/node/cjs/jwt/decrypt.js:10:61)\n' +
' at Object.decode (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/jwt/index.js:44:52)\n' +
' at async Object.session (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/core/routes/session.js:25:34)\n' +
' at async AuthHandler (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/core/index.js:161:37)\n' +
' at async getServerSession (webpack-internal:///(rsc)/../../node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/next/index.js:126:21)\n' +
' at async RootLayout (webpack-internal:///(rsc)/./src/app/layout.tsx:100:21)',
name: 'JWEInvalid'
}
Even following what is says in the link i can't figure it out
Solution:
GitHub
Need help in resolving 'Invalid Compact JWE' error in Next Auth · ...
I am trying to make next auth work with Neon's postgres database using Prisma and include Google's OAuth. So far i have done everything, and all the data of the user is successfully being s...
Jump to solution
1 Reply
Solution
Jacob
Jacob13mo ago
GitHub
Need help in resolving 'Invalid Compact JWE' error in Next Auth · ...
I am trying to make next auth work with Neon's postgres database using Prisma and include Google's OAuth. So far i have done everything, and all the data of the user is successfully being s...
Want results from more Discord servers?
Add your server