more work on testing

This commit is contained in:
Mikayla Dobson
2022-12-17 12:22:03 -06:00
parent a38bc2793f
commit 27e6b4aa1f
14 changed files with 96 additions and 62 deletions

View File

@@ -1,10 +1,11 @@
import { NextFunction, Request, Response } from "express"
import { StatusCode } from "../util/types";
export function restrictAccess(req: Request, res: Response, next: NextFunction) {
if (req.isAuthenticated()) {
next();
} else {
res.send({ ok: false, user: undefined })
res.status(StatusCode.Forbidden).send({ ok: false, user: undefined })
}
}