# new CurrentUser(userMap)
Creates a new CurrentUser instance from the provider parameters.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
userMap |
Object | Public User parameters
Properties
|
- Source:
Methods
# addIdentity(identity) → {Promise}
Adds Identity for the specified provider.
Parameters:
Name | Type | Description |
---|---|---|
identity |
Identity | AuthIdentity to be added. |
- Source:
Returns:
Promise successfull if identity added or error in case of ConflictUser or any other issue.
- Type
- Promise
# getBanInfo() → {BanInfo}
Returns reason and expiration of the ban of the current user.
- Source:
Returns:
Ban information
- Type
- BanInfo
# isAnonymous() → {bool}
Returns if current user has any authentication info attached.
- Source:
Returns:
true, if user does not have any authentication info attached.
- Type
- bool
# isBanned() → {bool}
Returns if user is banned or not.
- Source:
Returns:
True, if user is banned, otherwise false.
- Type
- bool
# refresh() → {Promise}
Refresh user properties.
- Source:
Returns:
Promise resolves when operation finishes.
- Type
- Promise
# removeIdentity(provider) → {Promise}
Removes Identity for the specified provider.
Parameters:
Name | Type | Description |
---|---|---|
provider |
string | The provider connected to an auth identity on the current user. |
- Source:
Returns:
Promise resolves when operation finishes.
- Type
- Promise
# updateDetails(update) → {Promise.<boolean>}
Requests a bulk change of properties for the current user.
Parameters:
Name | Type | Description |
---|---|---|
update |
UserUpdate | New user details. |
- Source:
Returns:
Promise to indicate if this operation was successful.
- Type
- Promise.<boolean>