Members
(constant) updateUserProfile
Updates the user profile fields
- Source:
Example
updateUserProfile({ firstName: 'Jane', lastName: 'Doe' })
Methods
deleteAccount() → {boolean}
Deletes the current user. Works only for the user who invoked this method!
- Source:
Returns:
true if removed else false
- Type
- boolean
Example
deleteAccount()
registerNewUser(options) → {Object.<{id: string, token: string=, tokenExpires: Date=}>}
Registers a new user by email+password and minimal profile fields.
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
- Source:
Returns:
object with at least the _id of the created user and optionally the token and tokenExpires values when user is logged in immediately
- Type
- Object.<{id: string, token: string=, tokenExpires: Date=}>
Example
registerNewUser({
email: janedow@example.com,
password: 'mysupersecretpw',
firstName: 'Jane',
lastName: 'Doe',
loginImmediately: true
})