From bb3362f2efa3f8f79b69dd2131181ab18db3c912 Mon Sep 17 00:00:00 2001 From: Bailey Pumfleet Date: Thu, 23 Sep 2021 10:02:53 +0100 Subject: [PATCH] Add JWT secret to next-auth.js (#730) --- .env.example | 2 ++ pages/api/auth/[...nextauth].tsx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/.env.example b/.env.example index 9e2aaa42..06dc08d0 100644 --- a/.env.example +++ b/.env.example @@ -5,6 +5,8 @@ GOOGLE_API_CREDENTIALS='secret' BASE_URL='http://localhost:3000' NEXT_PUBLIC_APP_URL='http://localhost:3000' +JWT_SECRET='secret' + # @see: https://github.com/calendso/calendso/issues/263 # Required for Vercel hosting - set NEXTAUTH_URL to equal your BASE_URL # NEXTAUTH_URL='http://localhost:3000' diff --git a/pages/api/auth/[...nextauth].tsx b/pages/api/auth/[...nextauth].tsx index 324e1c3c..68c5140e 100644 --- a/pages/api/auth/[...nextauth].tsx +++ b/pages/api/auth/[...nextauth].tsx @@ -10,6 +10,9 @@ export default NextAuth({ session: { jwt: true, }, + jwt: { + secret: process.env.JWT_SECRET, + }, pages: { signIn: "/auth/login", signOut: "/auth/logout",