fix(accounts): handle deletion failure in deleteUser method (#283)

- Added error handling for the `deleteUser` method to throw an error if the response contains an error property.
This commit is contained in:
Giancarlo Buomprisco
2025-06-17 07:13:59 +07:00
committed by GitHub
parent 1143a01727
commit 698e570545

View File

@@ -46,7 +46,11 @@ class DeletePersonalAccountService {
// execute the deletion of the user
try {
await params.adminClient.auth.admin.deleteUser(userId);
const response = await params.adminClient.auth.admin.deleteUser(userId);
if (response.error) {
throw response.error;
}
logger.info(ctx, 'User successfully deleted!');