diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-06-04 18:49:42 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-06-04 18:49:42 +0100 |
| commit | 8b2018852e54a005a39234d6965e6268192718dc (patch) | |
| tree | 65b140cffdb72d70247523d0313f5295db0951f7 /app/views/githublogin.py | |
| parent | 0aeefa2387846e482635c165916012d321da9ca6 (diff) | |
| download | cheatdb-8b2018852e54a005a39234d6965e6268192718dc.tar.xz | |
Add redirection to set password after login if not set
Diffstat (limited to 'app/views/githublogin.py')
| -rw-r--r-- | app/views/githublogin.py | 5 |
1 files changed, 4 insertions, 1 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")) |
