fix authenticate redirection