diff --git a/routes/api/all.js b/routes/api/all.js index a087bd1..459380d 100644 --- a/routes/api/all.js +++ b/routes/api/all.js @@ -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 diff --git a/server.js b/server.js index 705a03a..cc0528e 100644 --- a/server.js +++ b/server.js @@ -927,7 +927,12 @@ router.get("/*", async function(request, response) { } catch(ignored){ console.log(2,"error minifying",originalUrl); } - response.send(str) + + try { + response.send(str) + } catch(err) { + console.error(err) + } }) return; }