From 609cfe4d21c617a8404cb15ca17074adea8ade81 Mon Sep 17 00:00:00 2001 From: Patrick Michla Date: Mon, 6 Mar 2023 15:53:12 +0100 Subject: [PATCH] feat(authentication): change headers variable from const back to let --- nuxt/plugins/urql.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nuxt/plugins/urql.ts b/nuxt/plugins/urql.ts index 8ef59564c..9ebba0bbe 100644 --- a/nuxt/plugins/urql.ts +++ b/nuxt/plugins/urql.ts @@ -127,8 +127,8 @@ export default defineNuxtPlugin(async (nuxtApp) => { const store = useMaevsiStore(nuxtApp.$pinia) const jwt = store.jwt const turnstileKey = store.turnstileKey - const headers = {} as Record - + let headers = {} as Record + if (jwt) { consola.trace('GraphQL request authenticated with: ' + jwt) headers = { ...headers, authorization: `Bearer ${jwt}` }