diff options
| author | jw255 | 2018-04-10 23:30:51 +0100 |
|---|---|---|
| committer | jw255 | 2018-04-10 23:30:51 +0100 |
| commit | f7220be4e1b80cdba0fbaf41f7382cbf18561e2b (patch) | |
| tree | efb137a8db4649798e9eae7ad9de4cae2f9b3429 /src/FileRouter.ts | |
| parent | progress on testing (diff) | |
| download | medicine-f7220be4e1b80cdba0fbaf41f7382cbf18561e2b.tar.gz medicine-f7220be4e1b80cdba0fbaf41f7382cbf18561e2b.zip | |
sth works maybe
Diffstat (limited to 'src/FileRouter.ts')
| -rw-r--r-- | src/FileRouter.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/FileRouter.ts b/src/FileRouter.ts index 4d6eb16..4d68b6d 100644 --- a/src/FileRouter.ts +++ b/src/FileRouter.ts @@ -63,7 +63,7 @@ const getProtocols: Middleware = const postLog: Middleware = (req: Request, res: Response, next: NextFunction): void => { if (!req.user.hasPrivilege('logging')) { - next(new RequestError(400, 'invalid_privilege')); + next(new RequestError(401, 'invalid_privilege')); return; } else if (!logger.isEnabled()) { next(new RequestError(501, 'logging_not_enabled')); @@ -103,7 +103,7 @@ const postLog: Middleware = const getLog: Middleware = (req: Request, res: Response, next: NextFunction): void => { if (!req.user.hasPrivilege('admin')) { - next(new RequestError(400, 'invalid_privilege')); + next(new RequestError(401, 'invalid_privilege')); } res.locals.data = logger.fetch( req.params.level, { @@ -416,9 +416,11 @@ const getProjectName: Middleware = async(req: Request, res: Response, next: NextFunction): Promise<void> => { const project: Project | null = res.locals.project; if (project == null) { + console.log("was null") return next(new RequestError(404, 'project_not_found')); } else { res.locals.data = project.fullInfo; + console.log("wasnt " + res.locals.data) next(); } }; |
