Skip to content

Commit

Permalink
chore: improve auth error message
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Oct 2, 2024
1 parent 27b830c commit 780ff7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export async function requireNuxtHubAuthorization(event: H3Event) {
headers: {
authorization: `Bearer ${secretKeyOrUserToken}`
}
}).catch((err) => {
}).catch(() => {
throw createError({
statusCode: err.statusCode || 401,
message: err.data?.message || err.message || 'Unauthorized'
statusCode: 401,
message: 'Could not connect to project'
})
})
localCache.set(secretKeyOrUserToken, true)
Expand Down

0 comments on commit 780ff7d

Please sign in to comment.