Fix bug in the redirect of the login mechanism