Revert and fix redirect-login-failed-fix properly