exclude path from authentication
This commit is contained in:
parent
f28c9c20cc
commit
3252e91f6b
@ -21,6 +21,7 @@ declare global {
|
|||||||
|
|
||||||
export async function Authentication(req: Request, res: Response, next: NextFunction) {
|
export async function Authentication(req: Request, res: Response, next: NextFunction) {
|
||||||
if (!req.url.startsWith("/api")) return next();
|
if (!req.url.startsWith("/api")) return next();
|
||||||
|
if (req.url.startsWith("/api/v8/invites") && req.method === "GET") return next();
|
||||||
if (NO_AUTHORIZATION_ROUTES.some((x) => req.url.startsWith(x))) 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));
|
if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401));
|
||||||
// TODO: check if user is banned/token expired
|
// TODO: check if user is banned/token expired
|
||||||
|
Loading…
x
Reference in New Issue
Block a user