mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
fix(api): 🐛 Fix auth could not error when token was wrong and authorization required on a route
This commit is contained in:
parent
14d3a243a2
commit
ff14e5a5d3
|
|
@ -76,7 +76,7 @@ export const auth = (authData: APIRouteMetadata["auth"]) =>
|
|||
|
||||
const error = errorResponse("Unauthorized", 401);
|
||||
|
||||
if (!auth) {
|
||||
if (!auth?.user) {
|
||||
if (authData.required) {
|
||||
return context.json(
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue