Handling the redirection to the login route