From 9886aeac7e4794be03c5ef7a5056c6c709f53ca6 Mon Sep 17 00:00:00 2001 From: Andrew Henry Date: Fri, 1 Mar 2024 16:55:51 -0500 Subject: [PATCH] chore: various cleanup --- src/pages/api/auth/[...nextauth].ts | 5 +++-- src/server/middleware/auth.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/api/auth/[...nextauth].ts b/src/pages/api/auth/[...nextauth].ts index 0aab148..ca30766 100644 --- a/src/pages/api/auth/[...nextauth].ts +++ b/src/pages/api/auth/[...nextauth].ts @@ -53,14 +53,15 @@ export const nextAuthOptions: AuthOptions = { }, callbacks: { signIn: async (params) => { - const profile = params.profile as Profile & { login?: string } authLogger.debug('Sign in callback') + + const profile = params.profile as Profile & { login?: string } const allowedHandles = ( process.env.ALLOWED_HANDLES?.split(',') ?? [] ).filter((handle) => handle !== '') if (allowedHandles.length === 0) { - authLogger.debug( + authLogger.info( 'No allowed handles specified via ALLOWED_HANDLES, allowing all users.', ) return true diff --git a/src/server/middleware/auth.ts b/src/server/middleware/auth.ts index bef8e2f..3d1695a 100644 --- a/src/server/middleware/auth.ts +++ b/src/server/middleware/auth.ts @@ -4,7 +4,7 @@ import { Middleware } from 'server/trpc' export const verifyAuth: Middleware = async (opts) => { const { ctx } = opts - // Check validity of token + // Verify valid github session checkGitHubAuth(ctx.session?.user?.accessToken) return opts.next({