From 6a50edff22b789f48d8626bc2884f94203fa1d19 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Tue, 24 Sep 2024 12:31:57 +0530 Subject: [PATCH] fix: login & csrf api routes --- src/context/auth.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context/auth.tsx b/src/context/auth.tsx index 7d0d6c05..1d410f0c 100644 --- a/src/context/auth.tsx +++ b/src/context/auth.tsx @@ -68,7 +68,7 @@ const Provider = ({ children }: ProviderProps) => { if (res.status === 401 && res.config && !res.config.__isRetryRequest) { return new Promise((resolve, reject) => { axios - .get('/api/logout') + .get('http://localhost:8080/auth/logout') .then((data) => { console.log('/401 error > logout'); dispatch({ type: 'LOGOUT' }); @@ -88,7 +88,7 @@ const Provider = ({ children }: ProviderProps) => { // csrf - include tokens in the axios header every time a request is made useEffect(() => { const getCsrfToken = async () => { - const { data } = await axios.get('/api/csrf-token'); + const { data } = await axios.get('http://localhost:8080/csrf-token'); console.log('CSRFFFFF =>>>>', data); (axios.defaults.headers as any)['X-CSRF-TOKEN'] = data.getCsrfToken; };