From 044031260c9283a81d82b7592fa80174016f35d1 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 24 Sep 2024 12:09:50 +0530 Subject: [PATCH] feat: extend HeadersDefaults type to include X-CSRF-TOKEN property --- src/context/auth.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/auth.tsx b/src/context/auth.tsx index 98fa4b49..c66652ac 100644 --- a/src/context/auth.tsx +++ b/src/context/auth.tsx @@ -90,7 +90,7 @@ const Provider = ({ children }: ProviderProps) => { const getCsrfToken = async () => { const { data } = await axios.get('/api/csrf-token'); console.log('CSRFFFFF =>>>>', data); - axios.defaults.headers['X-CSRF-TOKEN'] = data.getCsrfToken; + (axios.defaults.headers as any)['X-CSRF-TOKEN'] = data.getCsrfToken; }; getCsrfToken(); }, []);