fix: authorization

This commit is contained in:
moolcoov
2025-03-01 20:33:17 +03:00
parent 345bd5bcf2
commit f86724ae80
2 changed files with 2 additions and 4 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ export const authFetch = ofetch.create({
export const apiFetch = ofetch.create({
baseURL: BASE_URL,
headers: {
Authorization: "Bearer " + getToken(),
async onRequest({ options }) {
options.headers.set("Authorization", "Bearer " + getToken());
},
async onResponseError({ response }) {
if (response.status === 401) {