From e28f31e0508309c8bea1e5bd56ab453a4ba96424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Auricoste?= Date: Wed, 15 Nov 2023 16:51:38 +0100 Subject: [PATCH] fix: suppression de l'ajout auto du header pour l'access token --- ui/utils/api.utils.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ui/utils/api.utils.ts b/ui/utils/api.utils.ts index bb4ffdd11d..872232bc5f 100644 --- a/ui/utils/api.utils.ts +++ b/ui/utils/api.utils.ts @@ -27,11 +27,6 @@ async function optionsToFetchParams(method: RequestInit["method"], options: IReq }) } - const accessToken = getAccessToken() - if (accessToken && !headers.has("authorization")) { - headers.append("authorization", `Bearer ${accessToken}`) - } - let body: BodyInit | undefined = undefined if ("body" in options && method !== "GET") { if (options.body instanceof FormData) { @@ -84,13 +79,6 @@ async function getHeaders(options: IRequestOptions) { const removeAtEnd = (url: string, removed: string): string => (url.endsWith(removed) ? url.slice(0, -removed.length) : url) -const getAccessToken = () => { - if (typeof window !== "undefined") { - const token = new URLSearchParams(window.location.search).get("token") - return token - } -} - export function generateUrl(path: string, options: WithQueryStringAndPathParam = {}): string { const params = "params" in options ? options.params : {} const querystring = "querystring" in options ? options.querystring : {}