implement proper jwt checking in authchecker

ref #12
This commit is contained in:
2020-12-05 17:59:43 +01:00
parent e5b605cc55
commit 76e19ca28d
4 changed files with 22 additions and 29 deletions

View File

@@ -5,14 +5,13 @@ import { createExpressServer } from "routing-controllers";
import authchecker from "./authchecker";
import loaders from "./loaders/index";
import { ErrorHandler } from './middlewares/ErrorHandler';
import { JWTAuth } from './middlewares/JWTAuth';
dotenvSafe.config();
const PORT = process.env.APP_PORT || 4010;
const app = createExpressServer({
authorizationChecker: authchecker,
middlewares: [ErrorHandler, JWTAuth],
middlewares: [ErrorHandler],
development: process.env.NODE_ENV === "production",
cors: true,
routePrefix: "/api",