From 13e61ab76b1b681147082973c48a05891882a832 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 19 Sep 2021 16:38:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20`config`=20parameter=20def?= =?UTF-8?q?ault=20value=20in=20`useLoginAxios`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/LoginContext.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/LoginContext.tsx b/frontend/src/components/LoginContext.tsx index 1eaeb9d..d6d5e1d 100644 --- a/frontend/src/components/LoginContext.tsx +++ b/frontend/src/components/LoginContext.tsx @@ -76,7 +76,7 @@ export function useLogin() { } -export function useLoginAxios(config: AxiosRequestConfig) { +export function useLoginAxios(config: AxiosRequestConfig = {}) { const instance = useInstance() const {userData} = useLogin() @@ -101,7 +101,7 @@ export function useLoginAxios(config: AxiosRequestConfig) { ...config, baseURL: instance.value, headers: { - ...config.headers, + ...config?.headers, authHeader, } })