From c846c6899b81fbf45871035b7a27d9cd9414616e Mon Sep 17 00:00:00 2001 From: Gihan Rangana Date: Wed, 11 Jan 2023 11:11:23 +0530 Subject: [PATCH] auth token fix --- src/lib/helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/helpers.ts b/src/lib/helpers.ts index 05fe0c0..128c0b7 100644 --- a/src/lib/helpers.ts +++ b/src/lib/helpers.ts @@ -39,10 +39,12 @@ export const innerShadow = (effect: any) => { export const imageURL = async (hash: any, id?: any, fileKey?: string | null) => { if (!fileKey) return; + const authToken = JSON.parse(localStorage.getItem("figmaAuthToken") || '') + let url = ''; const res = await axios.get(`https://api.figma.com/v1/images/${fileKey}?ids=${id}&format=png`, { headers: { - 'X-Figma-Token': import.meta.env.VITE_FIGMA_TOKEN + Authorization: `Bearer ${authToken.access_token}` } }) url = res.data.images[id]