Skip to content

Commit

Permalink
Add correct condition and remove log.
Browse files Browse the repository at this point in the history
Signed-off-by: Mirjam Aulbach <mirjam.aulbach@aiven.io>
  • Loading branch information
programmiri committed Feb 16, 2024
1 parent 19cd706 commit cfa346c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions coral/src/services/router-utils/route-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ const SuperadminRoute = ({
const redirectParam = routeParams[param] ? routeParams[param] : "";
const redirectPath = `${redirectStaticPart}${redirectParam}`;

const isSuperadmin = userrole !== "SUPERADMIN";
const isSuperadmin = userrole === "SUPERADMIN";

console.log("userrole", userrole);
useEffect(() => {
if (isSuperadmin && !showNotFound) {
window.location.replace(`${window.location.origin}${redirectPath}`);
Expand All @@ -203,7 +202,6 @@ const SuperadminRoute = ({
}

if (isSuperadmin && showNotFound) {
console.log("here");
return <NotFound />;
}

Expand Down

0 comments on commit cfa346c

Please sign in to comment.