aboutsummaryrefslogtreecommitdiff
path: root/app/views/githublogin.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-13 23:31:42 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-13 23:33:05 +0100
commitff8bf992a9048e55b58ece46cf25cc3a43edcef7 (patch)
tree02a1a7198a9fd20539465a0ccd378f0dd02f8913 /app/views/githublogin.py
parent31615da169766087a35c104d6aa8797a6eaa7594 (diff)
downloadcheatdb-ff8bf992a9048e55b58ece46cf25cc3a43edcef7.tar.xz
Add user account claiming
Diffstat (limited to 'app/views/githublogin.py')
-rw-r--r--app/views/githublogin.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/app/views/githublogin.py b/app/views/githublogin.py
index 875f1b2..114bb2b 100644
--- a/app/views/githublogin.py
+++ b/app/views/githublogin.py
@@ -43,16 +43,8 @@ def github_authorized(oauth_token):
# If not logged in, log in
else:
if userByGithub is None:
- newUser = User(username)
- newUser.github_username = username
- db.session.add(newUser)
- db.session.commit()
-
- if not loginUser(newUser):
- raise Exception("Unable to login as user we just created")
-
- flash("Created an account", "success")
- return redirect(url_for("user_profile_page", username=username))
+ 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"))
else: