How to delete user accounts via API without IP blocking

We have integrated Discourse with another app, and users are managed in Keycloak. When a user deletes his account in the other app, we also delete it via API in Discourse.
Works fine, but the user’s IP is then blocked automatically in Discourse, so there is no way to log in as a different user from the same IP.
Can this IP blocking be turned off? Or make it automatically unblock after some time?

Yes. You’ll need to in-check the thing that blocks the ip. See Reverse engineer the Discourse API and see what happens when you do it from the UX.

According to the API documentation for deleting a user, whether it blocks the IP is one of the options passed in with the body of the request.

So in the code where the request is being made, you should be able to provide json in the body of the request which includes ”block_ip”: false.

2 Likes

I’m not sure if I understand this.
Do you mean I have to unblock the IP via API after the account has been deleted?

I was actually hoping for some configuration switch in Discourse.

Ah, got it. Thanks, will try this.

2 Likes