diff options
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/githublogin.py | 5 | ||||
| -rw-r--r-- | app/views/users.py | 2 |
2 files changed, 5 insertions, 2 deletions
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")) diff --git a/app/views/users.py b/app/views/users.py index 43dea8e..256f7d1 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -162,7 +162,7 @@ def set_password_page(): else: flash("Passwords do not match", "error") - return render_template("users/set_password.html", form=form) + return render_template("users/set_password.html", form=form, optional=request.args.get("optional")) @app.route("/user/claim/", methods=["GET", "POST"]) |
