Re-implementing login redirection client-side.