✨ init test client

This commit is contained in:
Flam3rboy
2021-04-05 21:43:11 +02:00
parent c0fd1d1f2f
commit 6e009484a6
2 changed files with 45 additions and 5 deletions
+1
View File
@@ -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