Improve the invalidate tokens API handler

* Remove the TODO
* Replace the Console.info with logger.debug
This commit is contained in:
luukas 2022-05-25 00:35:11 +03:00
parent 9a9d101015
commit 2aa2d14f5e
No known key found for this signature in database
GPG Key ID: CC4915E8D71FC044

View File

@ -1,6 +1,5 @@
import datetime
import logging
from app.classes.shared.console import Console
from app.classes.web.base_api_handler import BaseApiHandler
logger = logging.getLogger(__name__)
@ -12,8 +11,7 @@ class ApiAuthInvalidateTokensHandler(BaseApiHandler):
if not auth_data:
return
# TODO: Invalidate tokens
Console.info("invalidate_tokens")
logger.debug(f"Invalidate tokens for user {auth_data[4]['user_id']}")
self.controller.users.raw_update_user(
auth_data[4]["user_id"], {"valid_tokens_from": datetime.datetime.now()}
)