Skip to content

Commit

Permalink
fix(frontend): revert change to ProtectedRoute attempting cookie access
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Mar 1, 2024
1 parent 5dcd774 commit 12ab56a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/frontend/src/utilities/ProtectedRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ const ProtectedRoute = ({ children }) => {
if (import.meta.env.MODE === 'development') {
return children;
}
console.log(import.meta.env, 'test');
// const token = CoreModules.useAppSelector((state) => state.login.loginToken);
const changedDomainToUnderscore = import.meta.env.VITE_FMTM_DOMAIN.replace('.', '_');
const token = getCookie(changedDomainToUnderscore);

const token = CoreModules.useAppSelector((state) => state.login.loginToken);
if (token == null) {
createLoginWindow('/');
return <Navigate to="/" replace />;
}

return children;
};
export default ProtectedRoute;

0 comments on commit 12ab56a

Please sign in to comment.