Skip to content

Commit

Permalink
chore: various cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ajhenry committed Mar 1, 2024
1 parent 22230e0 commit 9886aea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/server/middleware/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 9886aea

Please sign in to comment.