From b6ae53aab80cb30eb7c63eb83ef14feaa92edd24 Mon Sep 17 00:00:00 2001 From: Gabriel Silva Hermida <gash18@inf.ufpr.br> Date: Wed, 30 Sep 2020 11:51:47 -0300 Subject: [PATCH] Issue #50: Fix redirecionamento rotas Signed-off-by: Gabriel Silva Hermida <gash18@inf.ufpr.br> --- src/routes.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/routes.js b/src/routes.js index 42bab39..8a23828 100644 --- a/src/routes.js +++ b/src/routes.js @@ -12,11 +12,10 @@ import VisualizeForm from "./pages/VisualizeForm"; import { BrowserRouter, Route, Switch, Redirect } from "react-router-dom"; const PrivateRoute = ({ component: Component, ...rest }) => { - let usr; + let usr = true; rest.path === "/list/:id" && - rest.computedMatch.params.id === window.sessionStorage.getItem("userId") && - (usr = true); - + rest.computedMatch.params.id !== window.sessionStorage.getItem("userId") && + (usr = false); return ( <Route {...rest} -- GitLab