-
Notifications
You must be signed in to change notification settings - Fork 212
Closed
@ezzcodeezzlife
Description
Hey, after cloning and following the installation instructions i get this error (sorry for the long stacktrace but hope it helps):
[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:///(sc_server)/./node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:15)\n' +
' at jwtDecrypt (webpack-internal:///(sc_server)/./node_modules/jose/dist/node/cjs/jwt/decrypt.js:10:61)\n' +
' at Object.decode (webpack-internal:///(sc_server)/./node_modules/next-auth/jwt/index.js:44:52)\n' +
' at async Object.session (webpack-internal:///(sc_server)/./node_modules/next-auth/core/routes/session.js:25:34)\n' +
' at async AuthHandler (webpack-internal:///(sc_server)/./node_modules/next-auth/core/index.js:161:37)\n' +
' at async getServerSession (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:129:21)\n' +
' at async unstable_getServerSession (webpack-internal:///(sc_server)/./node_modules/next-auth/next/index.js:155:12)\n' +
' at async AuthStatus (webpack-internal:///(sc_server)/./components/auth-status.tsx:11:21)',
name: 'JWEInvalid'
}
Generated one here: https://generate-secret.vercel.app/32 (only required for localhost)
env.local
...
NEXTAUTH_SECRET=f6327cf5edcce9bb2def2dd44c13ac7c
NEXTAUTH_URL=http://localhost:3000 # and tried with http://localhost:3000/api/auth
[...nextauth].ts (route)
import GoogleProvider from "next-auth/providers/google";
import NextAuth from "next-auth";
import { PrismaAdapter } from "@auth/prisma-adapter";
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
const handler = NextAuth({
adapter: PrismaAdapter(prisma),
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
],
});
export { handler as GET, handler as POST };
Thanks in advance for guiding me to a solution!
Metadata
Metadata
Assignees
Labels
No labels