Delete User Account Component
PropelAuth's Delete User Account component allows you to customize the flow around a user deleting their account in your app.
Delete Account
Not sure how to use this component? Check out the Using the Documentation page.
Reference APIs
These are the APIs that are used by the above component. You can use these APIs directly in your own code.
deleteAccount
Deletes the logged in user's account from your application.
Response Functions
The response object has a handle function that you can use to handle the response. These functions can be async, and you can return values from them.
- Name
success
- Description
- Successful request.
- Name
actionDisabled
- Description
- The 'Users can delete their own accounts' setting in your PropelAuth dashboard is disabled
- Name
unauthorized
- Description
- The user is not logged in.
- Name
unexpectedOrUnhandled
- Description
- An unexpected error occurred.
Request
const { deleteAccount } = useAuthFrontendApis()
const response = await deleteAccount()
await response.handle({
success: async () => {
console.log('Account deleted')
},
actionDisabled(error) {
console.log('Cannot delete account', error.user_facing_error)
},
unexpectedOrUnhandled(error) {
console.log('Unexpected or unhandled error', error.user_facing_error)
},
})
Successful Response
{}