For most authentication methods, Realm automatically creates a user account the first time a user authenticates. The only exception is email/password authentication. When you use email/password authentication, you must register and confirm a user before the user can authenticate to a Realm application.
New in version 1.7.0.
App.deleteUser() on a user object to delete
the user's account from your Realm application. This deletes the account from
the server in addition to clearing local data.
To use your app in the future, the user must sign up for a new account. They can use the same credentials (depending on the authentication provider), but will not have the same User ID as their deleted account.
Deleting a user only deletes the user object, which may contain associated metadata from the associated auth provider. This does not delete custom user data or other user data that your app stores in a linked collection or external services.
Use the Authentication Trigger DELETE event to programmatically clean up other data when you delete a user. For example, you can delete the user's data from your custom user data collection or another service.