#8758 closed defect (bug) (fixed)
Ability to delete user account through REST API
Reported by: | niftythree | Owned by: | |
---|---|---|---|
Milestone: | 11.0.0 | Priority: | high |
Severity: | normal | Version: | 10.6.0 |
Component: | REST API | Keywords: | has-patch |
Cc: |
Description
Hi there,
We’re attempting to publish our app which interfaces with the BuddyPress REST API to the Apple App Store.
Our app was rejected, with one of the key reasons being that users are not able to delete their account directly through the app itself. Currently, if the user wants to delete their account, the app redirects them to the website via a browser window where they need to log in and perform the deletion.
This was done because there is no BuddyPress REST API endpoint available which can perform this task. Would it be possible to implement a new endpoint which facilitates the deletion of a user account?
Thanks.
Attachments (1)
Change History (7)
This ticket was mentioned in Slack in #buddypress by espellcaste. View the logs.
22 months ago
#2
@
22 months ago
- Keywords reporter-feedback added
- Milestone changed from Awaiting Review to 11.0.0
#3
@
22 months ago
FYI : in the BP REST API documentation, we have documented 2 endpoints:
- https://developer.buddypress.org/bp-rest-api/reference/members/#delete-a-specific-member
- https://developer.buddypress.org/bp-rest-api/reference/members/#delete-the-logged-in-member
So we do support deleting accounts. Unless WordPress has changed things it should work as expected.
#4
@
22 months ago
- Keywords has-patch added; reporter-feedback removed
- Priority changed from normal to high
- Type changed from enhancement to defect (bug)
@niftythree you were right about the buddypress/v1/members/me
route, the delete_item method is not implemented yet.
I just pulled a request on the BP REST API repository and asked @espellcaste to review it.
#5
@
22 months ago
- Resolution set to fixed
- Status changed from new to closed
It’s now possible to use DELETE buddypress/v1/members/me
with the BP REST API. The delete_current_item()
method has been implemented and is available in BuddyPress since 11.0.0-beta2. See https://plugins.trac.wordpress.org/browser/buddypress/tags/11.0.0-beta2/bp-members/classes/class-bp-rest-members-endpoint.php#L442
#6
@
22 months ago
Thank you @imath and @espellcaste
We have done some testing and all looks to be good.
We're trying to determine how we set reassign within the API. How does BuddyPress handle this on a website? For example, all of our members do not and will not have any posts in the future. Is it therefore okay to set reassign to a non-existent account with user ID -1 (reassign: -1)? Or will this have a negative consequence?
Thanks.
Hi, I believe DELETE buddypress/members/$user_id should remove the user if the logged in user is the one requesting the deletion or is an Admin.
Have you tested it?
If not, we'll definitely add it.