aboutsummaryrefslogtreecommitdiff
path: root/src/auth.ts
diff options
context:
space:
mode:
authorHafeez2018-04-20 16:59:50 +0100
committerHafeez2018-04-20 16:59:50 +0100
commitafdfe914feb3082fca5f735524175916ef221cb7 (patch)
treea2bff440ae74024020e3a2d9443551d7103a6eac /src/auth.ts
parentcommit for merge (diff)
parentFinalise CORS support with package corser (diff)
downloadmedicine-afdfe914feb3082fca5f735524175916ef221cb7.tar.gz
medicine-afdfe914feb3082fca5f735524175916ef221cb7.zip

asdas

Diffstat (limited to 'src/auth.ts')
-rw-r--r--src/auth.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/auth.ts b/src/auth.ts
index 14e1170..490ae35 100644
--- a/src/auth.ts
+++ b/src/auth.ts
@@ -211,7 +211,7 @@ export const unauthorisedErr: Errorware =
export const isAdmin: Middleware =
(req: Request, res: Response, next: NextFunction): void => {
// tslint:disable-next-line:no-non-null-assertion
- const admin: boolean = req!.user!.object!.userGroups!
+ const admin: boolean = req.user.object.userGroups
.some((x: UserGroup): boolean => x.name === 'admin');
if (!admin) {