mirror of
https://github.com/sasjs/server.git
synced 2026-01-03 21:10:05 +00:00
fix: csrf package is changed to pillarjs-csrf
This commit is contained in:
@@ -10,9 +10,7 @@ import { getPath, isPublicRoute } from '../utils'
|
||||
export const authorize: RequestHandler = async (req, res, next) => {
|
||||
const { user } = req
|
||||
|
||||
if (!user) {
|
||||
return res.sendStatus(401)
|
||||
}
|
||||
if (!user) return res.sendStatus(401)
|
||||
|
||||
// no need to check for permissions when user is admin
|
||||
if (user.isAdmin) return next()
|
||||
|
||||
Reference in New Issue
Block a user