Skip to content

Commit 780ff7d

Browse files
committed
chore: improve auth error message
1 parent 27b830c commit 780ff7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/runtime/utils/auth.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export async function requireNuxtHubAuthorization(event: H3Event) {
4646
headers: {
4747
authorization: `Bearer ${secretKeyOrUserToken}`
4848
}
49-
}).catch((err) => {
49+
}).catch(() => {
5050
throw createError({
51-
statusCode: err.statusCode || 401,
52-
message: err.data?.message || err.message || 'Unauthorized'
51+
statusCode: 401,
52+
message: 'Could not connect to project'
5353
})
5454
})
5555
localCache.set(secretKeyOrUserToken, true)

0 commit comments

Comments
 (0)