From f5e25f9a78b3b10ca8eda1f6d9aeee392ddfb885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Burdzy?= Date: Thu, 9 May 2024 01:51:57 +0200 Subject: [PATCH] finally working (this time seriously) --- src/services/Api.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/Api.js b/src/services/Api.js index cb85196..2557ee9 100644 --- a/src/services/Api.js +++ b/src/services/Api.js @@ -10,9 +10,10 @@ export const Api = axios.create({ }) Api.interceptors.request.use(function (config) { - const token = store.getState().user.token; - config.headers.Authorization = 'Bearer '+token; - + try{ + const token = store.getState().user.token; + config.headers.Authorization = 'Bearer ' + token; + }catch(e){} return config; }); // await Api.get('GameType/getAll')