uncommmented some code

This commit is contained in:
Legonois 2025-03-11 22:16:45 +00:00
parent 5bf86f1daa
commit b0952fcbbf

View File

@ -154,33 +154,33 @@ export const runAPI = async (express, app, __dirname, isPrimary = true) => {
}); });
app.post('/', (req, res, next) => { app.post('/', (req, res, next) => {
// if (!env.sessionEnabled || req.rateLimitKey) { if (!env.sessionEnabled || req.rateLimitKey) {
// return next(); return next();
// } }
// try { try {
// const authorization = req.header("Authorization"); const authorization = req.header("Authorization");
// if (!authorization) { if (!authorization) {
// return fail(res, "error.api.auth.jwt.missing"); return fail(res, "error.api.auth.jwt.missing");
// } }
// if (authorization.length >= 256) { if (authorization.length >= 256) {
// return fail(res, "error.api.auth.jwt.invalid"); return fail(res, "error.api.auth.jwt.invalid");
// } }
// const [ type, token, ...rest ] = authorization.split(" "); const [ type, token, ...rest ] = authorization.split(" ");
// if (!token || type.toLowerCase() !== 'bearer' || rest.length) { if (!token || type.toLowerCase() !== 'bearer' || rest.length) {
// return fail(res, "error.api.auth.jwt.invalid"); return fail(res, "error.api.auth.jwt.invalid");
// } }
// if (!jwt.verify(token)) { if (!jwt.verify(token)) {
// return fail(res, "error.api.auth.jwt.invalid"); return fail(res, "error.api.auth.jwt.invalid");
// } }
// req.rateLimitKey = hashHmac(token, 'rate'); req.rateLimitKey = hashHmac(token, 'rate');
// } catch { } catch {
// return fail(res, "error.api.generic"); return fail(res, "error.api.generic");
// } }
next(); next();
}); });