fix bug when not logged in

This commit is contained in:
Mystikfluu 2022-08-26 14:15:15 +02:00
parent ce2a1fb19e
commit 1a142c581b
2 changed files with 11 additions and 2 deletions

View File

@ -10,7 +10,11 @@ export const setup = function (router, con, server) {
res.set("Access-Control-Allow-Origin", "*"); //we'll allow it for now
let unsigned;
if (req.body.user == undefined || req.body.pass == undefined) {
unsigned = unsign.getunsigned(req, res);
if(!req.cookies.AUTH_COOKIE) {
next()
return
}
unsigned = unsign.unsign(req.cookies.AUTH_COOKIE, req, res);
if (!unsigned){
next()
return

View File

@ -927,7 +927,12 @@ router.get("/*", async function(request, response) {
} catch(ignored){
console.log(2,"error minifying",originalUrl);
}
try {
response.send(str)
} catch(err) {
console.error(err)
}
})
return;
}