CurrentUser

CurrentUser

# new CurrentUser(userMap)

Creates a new CurrentUser instance from the provider parameters.
Parameters:
Name Type Description
userMap Object Public User parameters
Properties
Name Type Attributes Default Description
id string User ID
displayName string User Display name
avatarUrl string <optional>
User Avatar URL
identities Array.<Object> <optional>
[] User identities map
publicProperties Object.<string, string> <optional>
{} User public properties
privateProperties Object.<string, string> <optional>
{} User private properties * @param {boolean} [userMap.verified=false] - True if user is verified

Methods

# addIdentity(identity) → {Promise}

Adds Identity for the specified provider.
Parameters:
Name Type Description
identity Identity AuthIdentity to be added.
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.
Returns:
Ban information
Type
BanInfo

# isAnonymous() → {bool}

Returns if current user has any authentication info attached.
Returns:
true, if user does not have any authentication info attached.
Type
bool

# isBanned() → {bool}

Returns if user is banned or not.
Returns:
True, if user is banned, otherwise false.
Type
bool

# refresh() → {Promise}

Refresh user properties.
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.
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.
Returns:
Promise to indicate if this operation was successful.
Type
Promise.<boolean>