From f90c09307521aeea2ccfcf611cbe92f871e65e37 Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Sat, 10 Sep 2022 18:29:18 +0200 Subject: [PATCH] add error code for invalid login cookie --- error_codes.txt | 1 + extra_modules/unsign.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/error_codes.txt b/error_codes.txt index 476de90..67e80d5 100644 --- a/error_codes.txt +++ b/error_codes.txt @@ -1,4 +1,5 @@ 400: generic error / unsorted +401: login error (invalid cookie) 402: login error (bad cookie) 403: login error (no cookie) 404: invalid url / not found diff --git a/extra_modules/unsign.js b/extra_modules/unsign.js index 29282f4..146fdb2 100644 --- a/extra_modules/unsign.js +++ b/extra_modules/unsign.js @@ -33,7 +33,7 @@ function getunsigned(req, res) { let unsigned = unsign(cookie, req, res); if (!unsigned) { try { - res.status(402); + res.status(401); res.json({ "error": "Bad auth cookie set" }); } catch (ignored) { } //sometimes it errors, gotta debug soon