add error code for invalid login cookie

This commit is contained in:
Mystikfluu 2022-09-10 18:29:18 +02:00
parent 21cfc8218b
commit f90c093075
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
400: generic error / unsorted 400: generic error / unsorted
401: login error (invalid cookie)
402: login error (bad cookie) 402: login error (bad cookie)
403: login error (no cookie) 403: login error (no cookie)
404: invalid url / not found 404: invalid url / not found

View File

@ -33,7 +33,7 @@ function getunsigned(req, res) {
let unsigned = unsign(cookie, req, res); let unsigned = unsign(cookie, req, res);
if (!unsigned) { if (!unsigned) {
try { try {
res.status(402); res.status(401);
res.json({ "error": "Bad auth cookie set" }); res.json({ "error": "Bad auth cookie set" });
} }
catch (ignored) { } //sometimes it errors, gotta debug soon catch (ignored) { } //sometimes it errors, gotta debug soon