aboutsummaryrefslogtreecommitdiff
path: root/api/auth
diff options
context:
space:
mode:
authorlonkaars <l.leblansch@gmail.com>2021-03-27 10:43:16 +0100
committerlonkaars <l.leblansch@gmail.com>2021-03-27 10:43:16 +0100
commit1117131e8efc528e5d6dc225e9346e2cb2b459f2 (patch)
tree763345631de43b0abc81fc9adfad9eececb8ab41 /api/auth
parenta73ef14133d500a61ef9e1c5d7f49ebb6529a23f (diff)
lil fix
Diffstat (limited to 'api/auth')
-rw-r--r--api/auth/login_token.py2
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__)