-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathcreate-delete-user.txt
53 lines (38 loc) · 1.9 KB
/
create-delete-user.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.. _web-create-and-delete-users:
==================================
Create and Delete a User - Web SDK
==================================
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
.. _web-create-user:
Create a User
-------------
For most :ref:`authentication methods <authentication-providers>`, Atlas App Services
automatically creates a :ref:`user account <user-accounts>` the first time
a user authenticates. The only exception is email/password authentication.
When you use email/password authentication, you must :ref:`register
<web-email-password-register-new-user>` and :ref:`confirm
<web-email-password-complete-confirmation>` a user before the user can
authenticate to an App.
.. _web-delete-user:
Delete a User
-------------
.. versionadded:: 1.7.0
Call the ``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.
.. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js
:language: javascript
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.
.. important:: Deleting All User Data
Deleting a user only deletes the :ref:`user object <user-objects>`,
which may contain associated metadata from the associated auth provider.
This does not delete :ref:`custom user data <web-access-custom-user-data>`
or other user data that your app stores in a linked collection or external services.
Use the :ref:`Authentication Trigger DELETE event <authentication-event-operation-types>`
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.