From 0fe7edb60f31843a249a728cd3ecf7b35ae747c1 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 7 Mar 2021 19:36:51 +0100 Subject: updated token_login --- 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 67b2a42..0c0b57c 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 not user_id else user_id + return None if len(user_id) == 0 else user_id[0] token = Blueprint('token', __name__) -- cgit v1.2.3