diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-23 18:22:41 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-23 18:22:41 +0100 |
| commit | 5c1320042975016ea0b2ad122f1d1712bd16dacd (patch) | |
| tree | eb57833b46f5f9a4a6bb762c09aea639a89f473b /app/views/githublogin.py | |
| parent | a0814f4792f92bcba0b38a60e6d876a924798008 (diff) | |
| download | cheatdb-5c1320042975016ea0b2ad122f1d1712bd16dacd.tar.xz | |
Fix GitHub login by making username case insensitive
Diffstat (limited to 'app/views/githublogin.py')
| -rw-r--r-- | app/views/githublogin.py | 3 |
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: |
