summary refs log tree commit diff
path: root/src/middlewares/Authentication.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-05 21:43:11 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-05 21:43:11 +0200
commit6e009484a68a4c3dd5bd4983bfd10ca3f6cdf28d (patch)
tree171eac3963873ebbc18a5a61c258dea2e77b0b8f /src/middlewares/Authentication.ts
parent:bug: fix body parser (diff)
downloadserver-6e009484a68a4c3dd5bd4983bfd10ca3f6cdf28d.tar.xz
:sparkles: init test client
Diffstat (limited to 'src/middlewares/Authentication.ts')
-rw-r--r--src/middlewares/Authentication.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/middlewares/Authentication.ts b/src/middlewares/Authentication.ts

index 65d5a2cf..4bfa219a 100644 --- a/src/middlewares/Authentication.ts +++ b/src/middlewares/Authentication.ts
@@ -14,6 +14,7 @@ declare global { } export async function Authentication(req: Request, res: Response, next: NextFunction) { + if (!req.url.startsWith("/api")) return next(); if (NO_AUTHORIZATION_ROUTES.some((x) => req.url.startsWith(x))) return next(); if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401)); // TODO: check if user is banned/token expired