Api v1.15.0 (#1616)

* refactor(chalice): enhanced delete member logic
This commit is contained in:
Kraiem Taha Yassine 2023-11-07 13:39:15 +01:00 committed by GitHub
parent 4bd6093dae
commit 0682b62770
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -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)}

View file

@ -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)}