mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 17:55:29 +01:00
Improve the invalidate tokens API handler
* Remove the TODO * Replace the Console.info with logger.debug
This commit is contained in:
parent
9a9d101015
commit
2aa2d14f5e
@ -1,6 +1,5 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
from app.classes.shared.console import Console
|
|
||||||
from app.classes.web.base_api_handler import BaseApiHandler
|
from app.classes.web.base_api_handler import BaseApiHandler
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -12,8 +11,7 @@ class ApiAuthInvalidateTokensHandler(BaseApiHandler):
|
|||||||
if not auth_data:
|
if not auth_data:
|
||||||
return
|
return
|
||||||
|
|
||||||
# TODO: Invalidate tokens
|
logger.debug(f"Invalidate tokens for user {auth_data[4]['user_id']}")
|
||||||
Console.info("invalidate_tokens")
|
|
||||||
self.controller.users.raw_update_user(
|
self.controller.users.raw_update_user(
|
||||||
auth_data[4]["user_id"], {"valid_tokens_from": datetime.datetime.now()}
|
auth_data[4]["user_id"], {"valid_tokens_from": datetime.datetime.now()}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user