diff --git a/CHANGELOG.md b/CHANGELOG.md index a40b3a49..d6691c23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,11 @@ ## v24.39 ### Pre-releases +- v24.39-alpha2 - v24.39-alpha1 ### Fix +- Log the credentials out when they are suspended (#425, `v24.39-alpha2`) - Fix credentials custom data editing (#424, `v24.39-alpha1`) --- diff --git a/seacatauth/credentials/service.py b/seacatauth/credentials/service.py index 6c92bb7a..0cd500a8 100644 --- a/seacatauth/credentials/service.py +++ b/seacatauth/credentials/service.py @@ -521,6 +521,11 @@ async def update_credentials(self, credentials_id: str, update_dict: dict, sessi }) self.App.PubSub.publish("Credentials.updated!", credentials_id=credentials_id) + # Log the credentials out if they have been suspended + if validated_data.get("suspended") is True: + session_service = self.App.get_service("seacatauth.SessionService") + await session_service.delete_sessions_by_credentials_id(credentials_id) + return {"status": "OK"}