fixed auth parsing

ref #6
This commit is contained in:
2020-11-27 21:16:15 +01:00
parent cb5f5b9ecb
commit 5f4aed2f02
3 changed files with 43 additions and 30 deletions

View File

@@ -0,0 +1,20 @@
import {
Middleware,
ExpressErrorMiddlewareInterface
} from "routing-controllers";
@Middleware({ type: "after" })
export class ErrorHandler implements ExpressErrorMiddlewareInterface {
public error(
error: any,
request: any,
response: any,
next: (err: any) => any
) {
if (response.headersSent) {
return;
}
response.json(error);
}
}