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, }); };