Methods
(static) _genId()
Only use for DI in tests to produce deterministic IDs.
(static) become(sessionToken) → {Promise}
Logs in a user with a session token. On success, this saves the session
to disk, so you can retrieve the currently logged in user using
current
.
Parameters:
Name | Type | Description |
---|---|---|
sessionToken |
String | The sessionToken to log in with. |
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) changePhoneNumber(mobilePhoneNumber, code) → {Promise}
Makes a call to reset user's account mobilePhoneNumber by sms code.
The sms code is sent by AV.User.requestChangePhoneNumber
Parameters:
Name | Type | Description |
---|---|---|
mobilePhoneNumber |
String | |
code |
String | The sms code. |
Returns:
- Type
- Promise
(static) current() → {AV.User}
Retrieves the currently logged in AVUser with a valid session,
either from memory or localStorage, if necessary.
Returns:
The currently logged in AV.User.
- Type
- AV.User
(static) currentAsync() → {Promise.<AV.User>}
Retrieves the currently logged in AVUser with a valid session,
either from memory or localStorage, if necessary.
Returns:
resolved with the currently logged in AV.User.
- Type
- Promise.<AV.User>
(static) followeeQuery(userObjectId) → {AV.FriendShipQuery}
Create a followee query for special user to query the user's followees.
Parameters:
Name | Type | Description |
---|---|---|
userObjectId |
String | The user object id. |
Returns:
- Type
- AV.FriendShipQuery
(static) followerQuery(userObjectId) → {AV.FriendShipQuery}
Create a follower query for special user to query the user's followers.
Parameters:
Name | Type | Description |
---|---|---|
userObjectId |
String | The user object id. |
Returns:
- Type
- AV.FriendShipQuery
(static) logIn(username, password) → {Promise}
- Source:
- See:
Logs in a user with a username (or email) and password. On success, this
saves the session to disk, so you can retrieve the currently logged in
user using
current
.
Parameters:
Name | Type | Description |
---|---|---|
username |
String | The username (or email) to log in with. |
password |
String | The password to log in with. |
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) loginAnonymously() → {Promise.<AV.User>}
Creates an anonymous user.
Returns:
- Type
- Promise.<AV.User>
(static) loginWithAuthData(authData, platform, optionsopt) → {Promise}
- Source:
- Since:
- 3.7.0
- See:
Signs up or logs in a user with a third party auth data(AccessToken).
On success, this saves the session to disk, so you can retrieve the currently
logged in user using
current
.
Example
AV.User.loginWithAuthData({
openid: 'abc123',
access_token: '123abc',
expires_in: 1382686496
}, 'weixin').then(function(user) {
//Access user here
}).catch(function(error) {
//console.error("error: ", error);
});
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
authData |
Object | The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 } | |||||||||
platform |
string | Available platform for sign up. | |||||||||
options |
Object |
<optional> |
Properties
|
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptionsopt) → {Promise.<AV.User>}
Signs up or logs in a user with a third party authData and unionId.
Example
AV.User.loginWithAuthDataAndUnionId({
openid: 'abc123',
access_token: '123abc',
expires_in: 1382686496
}, 'weixin', 'union123', {
unionIdPlatform: 'weixin',
asMainAccount: true,
}).then(function(user) {
//Access user here
}).catch(function(error) {
//console.error("error: ", error);
});
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
authData |
Object | The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 } | |||||||||||||||||||||
platform |
string | Available platform for sign up. | |||||||||||||||||||||
unionId |
string | ||||||||||||||||||||||
unionLoginOptions |
Object |
<optional> |
Properties
|
Returns:
A promise that is fulfilled with the user when completed.
- Type
- Promise.<AV.User>
(static) loginWithEmail(email, password) → {Promise}
Logs in a user with email and password.
Parameters:
Name | Type | Description |
---|---|---|
email |
String | The user's email. |
password |
String | The password to log in with. |
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) loginWithMiniApp(authInfo, optionopt)
Register or login using the identity of the current mini-app.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
authInfo |
Object | ||||||||||
option |
Object |
<optional> |
Properties
|
(static) logInWithMobilePhone(mobilePhone, password) → {Promise}
- Source:
- See:
Logs in a user with a mobile phone number and password. On success, this
saves the session to disk, so you can retrieve the currently logged in
user using
current
.
Parameters:
Name | Type | Description |
---|---|---|
mobilePhone |
String | The user's mobilePhoneNumber |
password |
String | The password to log in with. |
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) logInWithMobilePhoneSmsCode(mobilePhone, smsCode) → {Promise}
- Source:
- See:
Logs in a user with a mobile phone number and sms code sent by
AV.User.requestLoginSmsCode.On success, this
saves the session to disk, so you can retrieve the currently logged in
user using
current
.
Parameters:
Name | Type | Description |
---|---|---|
mobilePhone |
String | The user's mobilePhoneNumber |
smsCode |
String | The sms code sent by AV.User.requestLoginSmsCode |
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) loginWithQQApp(optionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 4.2.0
- Deprecated:
- please use AV.User.loginWithMiniApp
使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
仅在 QQ 小程序中可用。
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
(static) loginWithQQAppWithUnionId(unionLoginOptionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 4.2.0
- Deprecated:
- please use AV.User.loginWithMiniApp
使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
仅在 QQ 小程序中可用。
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unionLoginOptions |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
(static) loginWithWeapp(optionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 2.0.0
- Deprecated:
- please use AV.User.loginWithMiniApp
使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
仅在微信小程序中可用。
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
(static) loginWithWeappWithUnionId(unionLoginOptionsopt)
- Source:
- Since:
- 3.13.0
- Deprecated:
- please use AV.User.loginWithMiniApp
使用当前使用微信小程序的微信用户身份注册或登录,
仅在微信小程序中可用。
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unionLoginOptions |
Object |
<optional> |
Properties
|
(static) logOut() → {Promise}
Logs out the currently logged in user session. This will remove the
session from disk, log out of linked services, and future calls to
current
will return null
.
Returns:
- Type
- Promise
(static) mergeUnionId(authInfo, unionId, unionIdOptionopt)
Merge unionId into authInfo.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
authInfo |
Object | ||||||||||
unionId |
String | ||||||||||
unionIdOption |
Object |
<optional> |
Properties
|
(static) requestChangePhoneNumber(mobilePhoneNumber, ttlopt, optionsopt) → {Promise}
Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
This sms code allows current user to reset it's mobilePhoneNumber by
calling AV.User.changePhoneNumber
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mobilePhoneNumber |
String | ||
ttl |
Number |
<optional> |
ttl of sms code (default is 6 minutes) |
options |
SMSAuthOptions |
<optional> |
Returns:
- Type
- Promise
(static) requestEmailVerify(email) → {Promise}
Requests a verify email to be sent to the specified email address
associated with the user account. This email allows the user to securely
verify their email address on the AV site.
Parameters:
Name | Type | Description |
---|---|---|
email |
String | The email address associated with the user that doesn't verify their email address. |
Returns:
- Type
- Promise
(static) requestLoginSmsCode(mobilePhoneNumber, optionsopt) → {Promise}
Requests a logIn sms code to be sent to the specified mobile phone
number associated with the user account. This sms code allows the user to
login by AV.User.logInWithMobilePhoneSmsCode function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mobilePhoneNumber |
String | The mobile phone number associated with the user that want to login by AV.User.logInWithMobilePhoneSmsCode | |
options |
SMSAuthOptions |
<optional> |
Returns:
- Type
- Promise
(static) requestMobilePhoneVerify(mobilePhoneNumber, optionsopt) → {Promise}
Requests a verify sms code to be sent to the specified mobile phone
number associated with the user account. This sms code allows the user to
verify their mobile phone number by calling AV.User.verifyMobilePhone
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mobilePhoneNumber |
String | The mobile phone number associated with the user that doesn't verify their mobile phone number. | |
options |
SMSAuthOptions |
<optional> |
Returns:
- Type
- Promise
(static) requestPasswordReset(email) → {Promise}
Requests a password reset email to be sent to the specified email address
associated with the user account. This email allows the user to securely
reset their password on the AV site.
Parameters:
Name | Type | Description |
---|---|---|
email |
String | The email address associated with the user that forgot their password. |
Returns:
- Type
- Promise
(static) requestPasswordResetBySmsCode(mobilePhoneNumber, optionsopt) → {Promise}
Requests a reset password sms code to be sent to the specified mobile phone
number associated with the user account. This sms code allows the user to
reset their account's password by calling AV.User.resetPasswordBySmsCode
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
mobilePhoneNumber |
String | The mobile phone number associated with the user that doesn't verify their mobile phone number. | |
options |
SMSAuthOptions |
<optional> |
Returns:
- Type
- Promise
(static) resetPasswordBySmsCode(code, password, mobilePhoneNumber) → {Promise}
Makes a call to reset user's account password by sms code and new password.
The sms code is sent by AV.User.requestPasswordResetBySmsCode.
Parameters:
Name | Type | Description |
---|---|---|
code |
String | The sms code sent by AV.User.Cloud.requestSmsCode |
password |
String | The new password. |
mobilePhoneNumber |
String |
Returns:
A promise that will be resolved with the result
of the function.
- Type
- Promise
(static) signUp(username, password, attrsopt, optionsopt) → {Promise}
- Source:
- See:
Signs up a new user with a username (or email) and password.
This will create a new AV.User on the server, and also persist the
session in localStorage so that you can access the user using
#current.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
username |
String | The username (or email) to sign up with. | |
password |
String | The password to sign up with. | |
attrs |
Object |
<optional> |
Extra fields to set on the new user. |
options |
AuthOptions |
<optional> |
Returns:
A promise that is fulfilled with the user when
the signup completes.
- Type
- Promise
(static) signUpOrlogInWithAuthData()
- Source:
- Deprecated:
- renamed to AV.User.loginWithAuthData
(static) signUpOrlogInWithAuthDataAndUnionId()
- Source:
- Since:
- 3.5.0
- Deprecated:
- renamed to AV.User.loginWithAuthDataAndUnionId
(static) signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attributes, options) → {Promise}
Signs up or logs in a user with a mobilePhoneNumber and smsCode.
On success, this saves the session to disk, so you can retrieve the currently
logged in user using
current
.
Parameters:
Name | Type | Description |
---|---|---|
mobilePhoneNumber |
String | The user's mobilePhoneNumber. |
smsCode |
String | The sms code sent by AV.Cloud.requestSmsCode |
attributes |
Object | The user's other attributes such as username etc. |
options |
AuthOptions |
Returns:
A promise that is fulfilled with the user when
the login completes.
- Type
- Promise
(static) verifyMobilePhone(code, mobilePhoneNumber) → {Promise}
Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
If verify successfully,the user mobilePhoneVerified attribute will be true.
Parameters:
Name | Type | Description |
---|---|---|
code |
String | The sms code sent by AV.User.Cloud.requestSmsCode |
mobilePhoneNumber |
String |
Returns:
A promise that will be resolved with the result
of the function.
- Type
- Promise
associateWithAuthData(authData, platform) → {Promise.<AV.User>}
Associate the user with a third party authData.
Example
user.associateWithAuthData({
openid: 'abc123',
access_token: '123abc',
expires_in: 1382686496
}, 'weixin').then(function(user) {
//Access user here
}).catch(function(error) {
//console.error("error: ", error);
});
Parameters:
Name | Type | Description |
---|---|---|
authData |
Object | The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 } |
platform |
string | Available platform for sign up. |
Returns:
A promise that is fulfilled with the user when completed.
- Type
- Promise.<AV.User>
associateWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptionsopt) → {Promise.<AV.User>}
Associate the user with a third party authData and unionId.
Example
user.associateWithAuthDataAndUnionId({
openid: 'abc123',
access_token: '123abc',
expires_in: 1382686496
}, 'weixin', 'union123', {
unionIdPlatform: 'weixin',
asMainAccount: true,
}).then(function(user) {
//Access user here
}).catch(function(error) {
//console.error("error: ", error);
});
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
authData |
Object | The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 } | ||||||||||||||||
platform |
string | Available platform for sign up. | ||||||||||||||||
unionId |
string | |||||||||||||||||
unionLoginOptions |
Object |
<optional> |
Properties
|
Returns:
A promise that is fulfilled with the user when completed.
- Type
- Promise.<AV.User>
associateWithMiniApp(authInfoopt, optionopt) → {Promise.<AV.User>}
Associate the user with the identity of the current mini-app.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
authInfo |
Object |
<optional> |
|||||||||
option |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
associateWithQQApp(optionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 4.2.0
- Deprecated:
- Please use AV.User#associateWithMiniApp
将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
仅在 QQ 小程序中可用。
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
associateWithQQAppWithUnionId(unionId, unionOptionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 4.2.0
- Deprecated:
- Please use AV.User#associateWithMiniApp
将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
仅在 QQ 小程序中可用。
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unionId |
string | |||||||||||||||||
unionOptions |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
associateWithWeapp(optionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 3.13.0
- Deprecated:
- Please use AV.User#associateWithMiniApp
将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
仅在微信小程序中可用。
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
associateWithWeappWithUnionId(unionId, unionOptionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 3.13.0
- Deprecated:
- Please use AV.User#associateWithMiniApp
将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
仅在微信小程序中可用。
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
unionId |
string | |||||||||||||||||
unionOptions |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
authenticated()
- Source:
- Deprecated:
- 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(), 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
Checks whether this user is the current user and has been authenticated.
Returns:
(Boolean) whether this user is the current user and is logged in.
dissociateAuthData(platform) → {Promise.<AV.User>}
Unlinks a user from a service.
Parameters:
Name | Type | Description |
---|---|---|
platform |
string |
Returns:
- Type
- Promise.<AV.User>
fetch()
- Source:
- See:
follow(options, authOptionsopt)
Follow a user
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | AV.User | String | if an AV.User or string is given, it will be used as the target user.
Properties
|
|||||||||||||
authOptions |
AuthOptions |
<optional> |
followeeQuery()
- Source:
- Since:
- 0.3.0
- See:
Create a followee query to query the user's followees.
followerQuery()
- Source:
- Since:
- 0.3.0
- See:
Create a follower query to query the user's followers.
getEmail() → {String}
- Source:
- See:
Returns get("email").
Returns:
- Type
- String
getFollowersAndFollowees(optionsopt, authOptionsopt)
Get the user's followers and followees.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
||||||||||||
authOptions |
AuthOptions |
<optional> |
getMobilePhoneNumber() → {String}
- Source:
- See:
Returns get("mobilePhoneNumber").
Returns:
- Type
- String
getRoles(optionsopt) → {Promise.<Array.<AV.Role>>}
Get this user's Roles.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
AuthOptions |
<optional> |
Returns:
A promise that is fulfilled with the roles when
the query is complete.
- Type
- Promise.<Array.<AV.Role>>
getSessionToken() → {String}
Get sessionToken of current user.
Returns:
sessionToken
- Type
- String
getUsername() → {String}
- Source:
- See:
Returns get("username").
Returns:
- Type
- String
isAnonymous() → {boolean}
Checks whether a user is anonymous.
Returns:
- Type
- boolean
isAuthenticated()
Detects if current sessionToken is valid.
Returns:
Promise.
isCurrent()
Returns true if
current
would return this user.
linkWithWeapp() → {Promise.<AV.User>}
- Source:
- Deprecated:
- renamed to AV.User#associateWithWeapp
Returns:
- Type
- Promise.<AV.User>
logIn() → {Promise}
- Source:
- See:
Logs in a AV.User. On success, this saves the session to localStorage,
so you can retrieve the currently logged in user using
current
.
A username and password must be set before calling logIn.
Returns:
A promise that is fulfilled with the user when
the login is complete.
- Type
- Promise
loginWithAuthData()
The same with AV.User.loginWithAuthData, except that you can set attributes before login.
loginWithAuthDataAndUnionId()
The same with AV.User.loginWithAuthDataAndUnionId, except that you can set attributes before login.
loginWithMiniApp()
The same with AV.User.loginWithMiniApp, except that you can set attributes before login.
loginWithQQApp(optionsopt)
- Source:
- Since:
- 4.2.0
- Deprecated:
- please use AV.User#loginWithMiniApp
The same with AV.User.loginWithQQApp, except that you can set attributes before login.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
loginWithQQAppWithUnionId()
- Source:
- Since:
- 4.2.0
- Deprecated:
- please use AV.User#loginWithMiniApp
The same with AV.User.loginWithQQAppWithUnionId, except that you can set attributes before login.
loginWithWeapp(optionsopt) → {Promise.<AV.User>}
- Source:
- Since:
- 3.7.0
- Deprecated:
- please use AV.User#loginWithMiniApp
The same with AV.User.loginWithWeapp, except that you can set attributes before login.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
Returns:
- Type
- Promise.<AV.User>
loginWithWeappWithUnionId()
- Source:
- Since:
- 3.13.0
- Deprecated:
- please use AV.User#loginWithMiniApp
The same with AV.User.loginWithWeappWithUnionId, except that you can set attributes before login.
refreshSessionToken(optionsopt) → {Promise.<AV.User>}
Refresh sessionToken of current user.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
AuthOptions |
<optional> |
Returns:
user with refreshed sessionToken
- Type
- Promise.<AV.User>
save()
- Source:
- See:
setEmail(email, options) → {Boolean}
- Source:
- See:
Calls set("email", email, options) and returns the result.
Parameters:
Name | Type | Description |
---|---|---|
email |
String | |
options |
AuthOptions |
Returns:
- Type
- Boolean
setMobilePhoneNumber(mobilePhoneNumber) → {Boolean}
- Source:
- See:
Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
Parameters:
Name | Type | Description |
---|---|---|
mobilePhoneNumber |
String |
Returns:
- Type
- Boolean
setPassword(password) → {Boolean}
- Source:
- See:
Calls set("password", password, options) and returns the result.
Parameters:
Name | Type | Description |
---|---|---|
password |
String |
Returns:
- Type
- Boolean
setUsername(username) → {Boolean}
- Source:
- See:
Calls set("username", username, options) and returns the result.
Parameters:
Name | Type | Description |
---|---|---|
username |
String |
Returns:
- Type
- Boolean
signUp(attrs, options) → {Promise}
- Source:
- See:
Signs up a new user. You should call this instead of save for
new AV.Users. This will create a new AV.User on the server, and
also persist the session on disk so that you can access the user using
current
.
A username and password must be set before calling signUp.
Parameters:
Name | Type | Description |
---|---|---|
attrs |
Object | Extra fields to set on the new user, or null. |
options |
AuthOptions |
Returns:
A promise that is fulfilled when the signup
finishes.
- Type
- Promise
signUpOrlogInWithMobilePhone(attrs, options) → {Promise}
Signs up a new user with mobile phone and sms code.
You should call this instead of save for
new AV.Users. This will create a new AV.User on the server, and
also persist the session on disk so that you can access the user using
current
.
A username and password must be set before calling signUp.
Parameters:
Name | Type | Description |
---|---|---|
attrs |
Object | Extra fields to set on the new user, or null. |
options |
AuthOptions |
Returns:
A promise that is fulfilled when the signup
finishes.
- Type
- Promise
unfollow(options, authOptionsopt)
Unfollow a user.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
options |
Object | AV.User | String | if an AV.User or string is given, it will be used as the target user.
Properties
|
|||||||
authOptions |
AuthOptions |
<optional> |
updatePassword(oldPassword, newPassword, options)
Update user's new password safely based on old password.
Parameters:
Name | Type | Description |
---|---|---|
oldPassword |
String | the old password. |
newPassword |
String | the new password. |
options |
AuthOptions |