mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 13:01:10 +08:00
throwing instead of calling next - maybe it will fix double errors
This commit is contained in:
parent
c6e8b69435
commit
d2648fff07
1 changed files with 1 additions and 3 deletions
|
@ -6,9 +6,7 @@ module.exports = {
|
|||
try {
|
||||
const { authorization } = req.headers;
|
||||
if (!authorization)
|
||||
return next(
|
||||
new MonkeyError(404, "Unauthorized", "No authorization header")
|
||||
);
|
||||
throw new MonkeyError(404, "Unauthorized", "No authorization header");
|
||||
const token = authorization.split(" ");
|
||||
if (token[0].trim() !== "Bearer")
|
||||
return next(
|
||||
|
|
Loading…
Reference in a new issue