aboutsummaryrefslogtreecommitdiff
path: root/app/views/githublogin.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-23 18:22:41 +0100
committerrubenwardy <rw@rubenwardy.com>2018-05-23 18:22:41 +0100
commit5c1320042975016ea0b2ad122f1d1712bd16dacd (patch)
treeeb57833b46f5f9a4a6bb762c09aea639a89f473b /app/views/githublogin.py
parenta0814f4792f92bcba0b38a60e6d876a924798008 (diff)
downloadcheatdb-5c1320042975016ea0b2ad122f1d1712bd16dacd.tar.xz
Fix GitHub login by making username case insensitive
Diffstat (limited to 'app/views/githublogin.py')
-rw-r--r--app/views/githublogin.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/githublogin.py b/app/views/githublogin.py
index bc4bb9b..7320163 100644
--- a/app/views/githublogin.py
+++ b/app/views/githublogin.py
@@ -18,6 +18,7 @@
from flask import *
from flask_user import *
from flask_login import login_user, logout_user
+from sqlalchemy import func
import flask_menu as menu
from flask_github import GitHub
from app import app, github
@@ -44,7 +45,7 @@ def github_authorized(oauth_token):
username = r.json()["login"]
# Get user by github username
- userByGithub = User.query.filter_by(github_username=username).first()
+ userByGithub = User.query.filter(func.lower(User.github_username) == func.lower(username)).first()
# If logged in, connect
if current_user and current_user.is_authenticated: