mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-25 09:54:34 +00:00
🎨 clean up
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user