Skip to content

Commit

Permalink
Remove error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciabad committed Jun 9, 2024
1 parent 0cecb0a commit ee76637
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/server/helpers/auth/auth-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,7 @@ export const adminAuthMiddleware = (
withAuth(middleware, {
callbacks: {
authorized: ({ token }) => {
if (!token) {
console.error('adminAuthMiddleware: User has no token')
return false
}

if (!token.role) {
console.error(
`adminAuthMiddleware: User "${token.id}" (${token.email}) has no role`
)
return false
}

return token.role === 'admin'
return token?.role === 'admin'
},
},
pages: {
Expand Down

0 comments on commit ee76637

Please sign in to comment.