aboutsummaryrefslogtreecommitdiff
path: root/src/auth.ts
diff options
context:
space:
mode:
authorTom Harley2018-04-20 15:15:46 +0100
committerTom Harley2018-04-20 15:16:25 +0100
commit8d0293af5592402448769451f85ce666ed407cb4 (patch)
tree95e19e5d09b46c5a509f2c5f58fc57f7956168be /src/auth.ts
parentreduced # of failing tests (diff)
downloadmedicine-8d0293af5592402448769451f85ce666ed407cb4.tar.gz
medicine-8d0293af5592402448769451f85ce666ed407cb4.zip

Finalise CORS support with package corser

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) {