mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 17:55:29 +01:00
2aa2d14f5e
* Remove the TODO * Replace the Console.info with logger.debug
20 lines
564 B
Python
20 lines
564 B
Python
import datetime
|
|
import logging
|
|
from app.classes.web.base_api_handler import BaseApiHandler
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class ApiAuthInvalidateTokensHandler(BaseApiHandler):
|
|
def post(self):
|
|
auth_data = self.authenticate_user()
|
|
if not auth_data:
|
|
return
|
|
|
|
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()}
|
|
)
|
|
|
|
self.finish_json(200, {"status": "ok"})
|