Ignore:
Timestamp:
02/04/24 16:57:49 (6 months ago)
Author:
darsov2 <62809499+darsov2@…>
Branches:
master
Children:
efaa053
Parents:
07f4e8b
Message:

ouath, mailing impl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/Components/Misc/PrivateRoute.js

    r07f4e8b r0f5aa27  
    55function PrivateRoute({ children }) {
    66  const { userIsAuthenticated } = useAuth()
    7   return userIsAuthenticated() ? children : <Navigate to="/login" />
     7  if(userIsAuthenticated())
     8  {
     9    return children;
     10  }
     11  else
     12  {
     13    window.location.href = "http://localhost:8080/login";
     14  }
     15  return userIsAuthenticated() ? children : <Navigate to="http://localhost:8080/login" />
    816}
    917
Note: See TracChangeset for help on using the changeset viewer.