From ced218b9dd71d04822dcc746cd6a5a187200e087 Mon Sep 17 00:00:00 2001 From: "swyx.io" Date: Wed, 5 Jul 2023 12:00:46 -0400 Subject: [PATCH] Comment suggestions for auth.ts --- auth.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/auth.ts b/auth.ts index d272d78db..7a660f0fd 100644 --- a/auth.ts +++ b/auth.ts @@ -1,6 +1,5 @@ import NextAuth, { type DefaultSession } from 'next-auth' import GitHub from 'next-auth/providers/github' -import { NextResponse } from 'next/server' declare module 'next-auth' { interface Session { @@ -14,7 +13,7 @@ declare module 'next-auth' { export const { handlers: { GET, POST }, auth, - CSRF_experimental + CSRF_experimental // will be removed in future } = NextAuth({ providers: [GitHub], callbacks: { @@ -26,10 +25,10 @@ export const { return token }, authorized({ auth }) { - return !!auth?.user + return !!auth?.user // this ensures there is a logged in user for -every- request } }, pages: { - signIn: '/sign-in' + signIn: '/sign-in' // overrides the next-auth default signin page https://authjs.dev/guides/basics/pages } })