From 4202ed3d7aa6743d8ff526b866e79f5c0c0bd205 Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Thu, 26 Nov 2020 15:09:29 +0200 Subject: [PATCH] next auth settings --- .env | 4 +++- TODO.md | 2 ++ pages/api/auth/[...nextauth].ts | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 5865b6657..89aea57b0 100644 --- a/.env +++ b/.env @@ -1,3 +1,5 @@ # used for log-in DISCORD_CLIENT_ID= -DISCORD_CLIENT_SECRET= \ No newline at end of file +DISCORD_CLIENT_SECRET= +JWT_SECRET= +NEXTAUTH_URL= \ No newline at end of file diff --git a/TODO.md b/TODO.md index 47a28ce95..3f725a0af 100644 --- a/TODO.md +++ b/TODO.md @@ -8,6 +8,8 @@ - [ ] Localization - [ ] Script to parse old translations into new format - [ ] Can change translations on the site +- [ ] Set favicon +- [ ] Social media preview / SEO stuff ### Before being able to shut down old site and bot diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index 08689e744..d5e8fae1b 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -14,6 +14,9 @@ const options: InitOptions = { scope: "identify", }), ], + jwt: { + secret: process.env.JWT_SECRET!, + }, callbacks: { session: async (_, user) => { return Promise.resolve(user);