Move server directory outside of frontend src

This commit is contained in:
jeffvli
2022-10-25 16:52:45 -07:00
parent 863dce88b7
commit 0438f2d5f2
105 changed files with 16946 additions and 6901 deletions
+20
View File
@@ -0,0 +1,20 @@
import { NextFunction, Request, Response } from 'express';
export const authenticateAdmin = (
req: Request,
res: Response,
next: NextFunction
) => {
if (!req.authUser.isAdmin) {
return res.status(403).json({
error: {
message: 'This action requires an administrator account.',
path: req.path,
},
response: 'Error',
statusCode: 403,
});
}
return next();
};