Return 401 instead of 403

This commit is contained in:
Adria Navarro 2024-07-10 13:26:02 +02:00
parent b06eb277a4
commit 8b40e80750
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ const authorized =
}
if (!ctx.user) {
return ctx.throw(403, "No user info found")
return ctx.throw(401, "No user info found")
}
// get the resource roles
@ -148,7 +148,7 @@ const authorized =
// check authenticated
if (!ctx.isAuthenticated) {
return ctx.throw(403, "Session not authenticated")
return ctx.throw(401, "Session not authenticated")
}
// check general builder stuff, this middleware is a good way