changed error code

This commit is contained in:
Miodec 2021-08-18 01:05:58 +01:00
parent 2c510eb7a9
commit 1e6f90f60f

View file

@ -6,7 +6,7 @@ module.exports = {
try {
const { authorization } = req.headers;
if (!authorization)
throw new MonkeyError(404, "Unauthorized", "No authorization header");
throw new MonkeyError(401, "Unauthorized", "No authorization header");
const token = authorization.split(" ");
if (token[0].trim() !== "Bearer")
return next(