boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

AuthenticateTeacherUser should redirect to /posts #188

Closed lucianosimoni closed 1 year ago

lucianosimoni commented 1 year ago

In the App.js:

const AuthenticateTeacherUser = ({
  children,
  loggedInUser,
  redirectPath = '/' <-------------------------------------------------------------
}) => {
  if (!isLoggedIn() || loggedInUser.role !== 'TEACHER') {
    return <Navigate to={redirectPath} replace />
  }

  return <Outlet />
}

It is sending the user to the Login page, which is not cool 🥲. It should send the user to the /posts

Auenc commented 1 year ago

Looks good to me!