mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 14:02:24 +01:00
Check that GitHub doesn't pass a null user id
This commit is contained in:
parent
f5dd77fcb3
commit
64414a3731
@ -68,9 +68,11 @@ def callback(oauth_token):
|
||||
json = r.json()
|
||||
user_id = json["id"]
|
||||
username = json["login"]
|
||||
if type(user_id) is not int:
|
||||
abort(400)
|
||||
|
||||
# Get user by GitHub user ID
|
||||
userByGithub = User.query.filter(User.github_user_id == user_id).first()
|
||||
userByGithub = User.query.filter(User.github_user_id == user_id).one_or_none()
|
||||
|
||||
# If logged in, connect
|
||||
if current_user and current_user.is_authenticated:
|
||||
|
Loading…
Reference in New Issue
Block a user