From 0682b627702fe3a5885ff6ce20779b3a00728e60 Mon Sep 17 00:00:00 2001 From: Kraiem Taha Yassine Date: Tue, 7 Nov 2023 13:39:15 +0100 Subject: [PATCH] Api v1.15.0 (#1616) * refactor(chalice): enhanced delete member logic --- api/chalicelib/core/users.py | 6 +++++- ee/api/chalicelib/core/users.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/api/chalicelib/core/users.py b/api/chalicelib/core/users.py index 13d76552a..3e5758004 100644 --- a/api/chalicelib/core/users.py +++ b/api/chalicelib/core/users.py @@ -436,7 +436,11 @@ def delete_member(user_id, tenant_id, id_to_delete): {"user_id": id_to_delete})) cur.execute( cur.mogrify(f"""UPDATE public.basic_authentication - SET password= NULL + SET password= NULL, jwt_iat= NULL, + jwt_refresh_jti= NULL, jwt_refresh_iat= NULL, + password= NULL, invitation_token= NULL, + invited_at= NULL, changed_at= NULL, + change_pwd_expire_at= NULL, change_pwd_token= NULL WHERE user_id=%(user_id)s;""", {"user_id": id_to_delete})) return {"data": get_members(tenant_id=tenant_id)} diff --git a/ee/api/chalicelib/core/users.py b/ee/api/chalicelib/core/users.py index d02b5ff4c..79aabaafe 100644 --- a/ee/api/chalicelib/core/users.py +++ b/ee/api/chalicelib/core/users.py @@ -495,7 +495,11 @@ def delete_member(user_id, tenant_id, id_to_delete): {"user_id": id_to_delete, "tenant_id": tenant_id})) cur.execute( cur.mogrify(f"""UPDATE public.basic_authentication - SET password=NULL + SET password=NULL, jwt_iat= NULL, + jwt_refresh_jti= NULL, jwt_refresh_iat= NULL, + password= NULL, invitation_token= NULL, + invited_at= NULL, changed_at= NULL, + change_pwd_expire_at= NULL, change_pwd_token= NULL WHERE user_id=%(user_id)s;""", {"user_id": id_to_delete, "tenant_id": tenant_id})) return {"data": get_members(tenant_id=tenant_id)}