From f86724ae80427f4684bf9d8b5235406c8309b8aa Mon Sep 17 00:00:00 2001 From: moolcoov Date: Sat, 1 Mar 2025 20:33:17 +0300 Subject: [PATCH] fix: authorization --- services/frontend/src/shared/api/index.ts | 4 ++-- services/frontend/src/shared/token.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/services/frontend/src/shared/api/index.ts b/services/frontend/src/shared/api/index.ts index 1edcff5..a2d9be0 100644 --- a/services/frontend/src/shared/api/index.ts +++ b/services/frontend/src/shared/api/index.ts @@ -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) { diff --git a/services/frontend/src/shared/token.ts b/services/frontend/src/shared/token.ts index 03ef7b2..f178673 100644 --- a/services/frontend/src/shared/token.ts +++ b/services/frontend/src/shared/token.ts @@ -6,8 +6,6 @@ export const getToken = () => { export const saveToken = (token: string) => { Cookie.set("token", token, { - secure: true, - sameSite: "Strict", expires: 30, }); };