From dae86118ed5d4026d04acb9d0e36829b9ad8eb4e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Mar 2019 10:35:15 +0100 Subject: Cleanup express locals typings --- server/middlewares/user-right.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'server/middlewares/user-right.ts') diff --git a/server/middlewares/user-right.ts b/server/middlewares/user-right.ts index 7cea7aa1e..498e3d677 100644 --- a/server/middlewares/user-right.ts +++ b/server/middlewares/user-right.ts @@ -2,11 +2,10 @@ import * as express from 'express' import 'express-validator' import { UserRight } from '../../shared' import { logger } from '../helpers/logger' -import { UserModel } from '../models/account/user' function ensureUserHasRight (userRight: UserRight) { return function (req: express.Request, res: express.Response, next: express.NextFunction) { - const user = res.locals.oauth.token.user as UserModel + const user = res.locals.oauth.token.user if (user.hasRight(userRight) === false) { const message = `User ${user.username} does not have right ${UserRight[userRight]} to access to ${req.path}.` logger.info(message) -- cgit v1.2.3