diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-03-27 10:43:16 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-03-27 10:43:16 +0100 |
commit | 1117131e8efc528e5d6dc225e9346e2cb2b459f2 (patch) | |
tree | 763345631de43b0abc81fc9adfad9eececb8ab41 /api/auth/login_token.py | |
parent | a73ef14133d500a61ef9e1c5d7f49ebb6529a23f (diff) |
lil fix
Diffstat (limited to 'api/auth/login_token.py')
-rw-r--r-- | api/auth/login_token.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/auth/login_token.py b/api/auth/login_token.py index 0c0b57c..d5b0e52 100644 --- a/api/auth/login_token.py +++ b/api/auth/login_token.py @@ -5,7 +5,7 @@ from auth.token import validate_token, hash_token def token_login(token): hashed = hash_token({ "token": token, "expirationDate": 0 }) user_id = cursor.execute("select user_id from users where valid_tokens like ?", [f"%{hashed['token']}%"]).fetchone() - return None if len(user_id) == 0 else user_id[0] + return None if not user_id else user_id[0] token = Blueprint('token', __name__) |