When developing an application or a website, some routes may need to be blocked from unauthorized access. As a result, the concept of a Protected Route is utilized to restrict unwanted access.
If the user is not logged in, user will be directed to login page or else will be directed to profile page. If the user is on the profile page or has already logged in, click the logout button to return to the login page.