mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-31 21:06:10 +01:00
45c3f73eca
This reverts the 4.4.1 release revert commit 29ce7a2cdeb59b4d769f4b107a24cece44b7a214.
20 lines
593 B
Python
20 lines
593 B
Python
import logging
|
|
from app.classes.web.base_api_handler import BaseApiHandler
|
|
from app.classes.shared.helpers import Helpers
|
|
|
|
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": Helpers.get_utc_now()}
|
|
)
|
|
|
|
self.finish_json(200, {"status": "ok"})
|