From ec13656660f921abef0b6dc2a16d31f64a948e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 21 Mar 2024 18:30:03 -0400 Subject: [PATCH] refactor(composables): update `useApiFetch` composable add authorization header --- composables/useApiFetch.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composables/useApiFetch.ts b/composables/useApiFetch.ts index bc336bf..49f60a9 100644 --- a/composables/useApiFetch.ts +++ b/composables/useApiFetch.ts @@ -1,13 +1,13 @@ import { AsyncData } from "#app"; const useApiFetch = async (url: string, options?: any) => { - // const { token } = useAuth(); + const { token } = useAuth(); let head = { ...(options?.headers || {}), }; - // if (token.value) { - // head.Authorization = token.value; - // } + if (token.value) { + head.Authorization = token.value; + } /* const cached = useSessionStorage(url, null, { serializer: StorageSerializers.object, });