fix(api): 🐛 Fix auth could not error when token was wrong and authorization required on a route

This commit is contained in:
Jesse Wierzbinski 2024-05-12 13:53:49 -10:00
parent 14d3a243a2
commit ff14e5a5d3
No known key found for this signature in database

View file

@ -76,7 +76,7 @@ export const auth = (authData: APIRouteMetadata["auth"]) =>
const error = errorResponse("Unauthorized", 401); const error = errorResponse("Unauthorized", 401);
if (!auth) { if (!auth?.user) {
if (authData.required) { if (authData.required) {
return context.json( return context.json(
{ {