Skip to content

Commit

Permalink
auth token fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gihanrangana committed Jan 11, 2023
1 parent fbb0c69 commit c846c68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

1 comment on commit c846c68

@vercel
Copy link

@vercel vercel bot commented on c846c68 Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.