Fix cycle login when redirecting