fix: if no authorization, directly return 401

This commit is contained in:
alt0
2022-12-22 21:47:46 +08:00
parent 2d0b81f2f0
commit 88bb20505e
@@ -26,6 +26,8 @@ export const client = bareClient.extend({
if (token.isLogin) {
if (token.isExpired) await token.refreshToken();
request.headers.set('Authorization', token.token);
} else {
return new Response('Unauthorized', { status: 401 });
}
},
],