mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-09 13:44:29 +08:00
changed error code
This commit is contained in:
parent
2c510eb7a9
commit
1e6f90f60f
1 changed files with 1 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue