🎨 clean up

This commit is contained in:
Flam3rboy committed 2021-08-17 22:42:16 +02:00
1 parent a467c86399
commit d8b01058b3
8 files changed
+10 -18

No files matched your search

+4 -3
View File
@@ -27,11 +27,12 @@ declare global {
export async function Authentication(req: Request, res: Response, next: NextFunction) {
if (req.method === "OPTIONS") return res.sendStatus(204);
if (req.url.startsWith("/invites") && req.method === "GET") return next(); // @ts-ignore
const url = req.url.replace(API_PREFIX, "");
if (url.startsWith("/invites") && req.method === "GET") return next(); // @ts-ignore
if (
NO_AUTHORIZATION_ROUTES.some((x) => {
if (typeof x === "string") return req.url.startsWith(x);
return x.test(req.url);
if (typeof x === "string") return url.startsWith(x);
return x.test(url);
})
)
return next();
-1
View File
@@ -4,7 +4,6 @@ import bcrypt from "bcrypt";
import jwt from "jsonwebtoken";
import { Config, UserModel } from "@fosscord/util";
import { adjustEmail } from "./register";
import RateLimit from "../../middlewares/RateLimit";
const router: Router = Router();
export default router;