diff options
Diffstat (limited to 'api')
-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__) |