From 1117131e8efc528e5d6dc225e9346e2cb2b459f2 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 27 Mar 2021 10:43:16 +0100 Subject: lil fix --- api/auth/login_token.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api/auth') 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__) -- cgit v1.2.3