From 8b2018852e54a005a39234d6965e6268192718dc Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 4 Jun 2018 18:49:42 +0100 Subject: Add redirection to set password after login if not set --- app/views/githublogin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/views/githublogin.py') diff --git a/app/views/githublogin.py b/app/views/githublogin.py index 7320163..defdad1 100644 --- a/app/views/githublogin.py +++ b/app/views/githublogin.py @@ -64,7 +64,10 @@ def github_authorized(oauth_token): flash("Unable to find an account for that Github user", "error") return redirect(url_for("user_claim_page")) elif loginUser(userByGithub): - return redirect(next_url or url_for("home_page")) + if current_user.password is None: + return redirect(next_url or url_for("set_password_page", optional=True)) + else: + return redirect(next_url or url_for("home_page")) else: flash("Authorization failed [err=gh-login-failed]", "danger") return redirect(url_for("user.login")) -- cgit v1.2.3