Put in order · JavaScript and React course · Module 6: React Router

Authorization flow in ProtectedRoute

Arrange the steps for handling unauthorized access to a protected route:

Items to put in order

  • ProtectedRoute checks the authentication state (isAuthenticated)
  • After logging in, the user returns to the protected route
  • The browser redirects to the login page
  • The component renders <Navigate to='/login' />
  • The user tries to access a protected route

You can check the correct answer by solving this task in the CodeWorlds game.