Correct redirects on login and logout