From 1c31cd69a1a63204124edb2051063ad29d3be047 Mon Sep 17 00:00:00 2001 From: Alberto Defendi <1369-ahl-berto@users.noreply.gitlab.inf.unibz.it> Date: Wed, 28 Apr 2021 09:31:44 +0200 Subject: [PATCH] Remove inappropriate negation in api response causing no login --- src/components/api/PrivateRoute/PrivateRoute.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/api/PrivateRoute/PrivateRoute.tsx b/src/components/api/PrivateRoute/PrivateRoute.tsx index 60332f8..e9e431c 100644 --- a/src/components/api/PrivateRoute/PrivateRoute.tsx +++ b/src/components/api/PrivateRoute/PrivateRoute.tsx @@ -25,12 +25,10 @@ export const PrivateRoute = ({ useEffect(() => { const fetch = async (): Promise<unknown> => { const result = await axios('/api/web/login/is_authenticated'); - // FIX: Remove negation and use true server data - setAuth(!result.data.is_authenticated); + setAuth(result.data.is_authenticated); setLoading(true); return null; }; - fetch(); }, []); -- GitLab