new Account()
Wrapper around account endpoint. Meant to be used directly form Syncano instance.
- Source:
Example
const {Account} = Syncano(); Account.login({email: '', password: ''}).then((user) => { });
Methods
-
activate(payload)
-
A convenience method for activating an accoung.
Parameters:
Name Type Description payload
Object Properties
Name Type Description uid
String token
String - Source:
Returns:
- Type
- Promise
-
changePassword(payload)
-
A convenience method for changing an accoung.
Parameters:
Name Type Description payload
Object Properties
Name Type Description current_password
String new_password
String - Source:
Returns:
- Type
- Promise
-
confirmPasswordReset(payload)
-
A convenience method for confirming password reset.
Parameters:
Name Type Description payload
Object Properties
Name Type Description uid
String token
String new_password
String - Source:
Returns:
- Type
- Promise
-
getUserDetails()
-
A convenience method for getting the currently logged in user details.
- Source:
Returns:
- Type
- Promise
-
login(payload [, setAccountKey])
-
A convenience method for authenticating with email and password.
Parameters:
Name Type Argument Default Description payload
Object Properties
Name Type Description email
String password
String setAccountKey
Boolean <optional>
true - Source:
Returns:
- Type
- Promise
-
register(payload)
-
A convenience method for creating a new account.
Parameters:
Name Type Description payload
Object Properties
Name Type Description email
String password
String - Source:
Returns:
- Type
- Promise
-
resendEmail(email)
-
A convenience method for resending email.
Parameters:
Name Type Description email
String - Source:
Returns:
- Type
- Promise
-
resetKey()
-
A convenience method for resetting the account key.
- Source:
Returns:
- Type
- Promise
-
resetPassword(email)
-
A convenience method for resetting the password.
Parameters:
Name Type Description email
String - Source:
Returns:
- Type
- Promise
-
setPassword(password)
-
A convenience method for setting the password.
Parameters:
Name Type Description password
String - Source:
Returns:
- Type
- Promise
-
socialLogin(backend, access_token)
-
A convenience method for authenticating with a social media token.
Parameters:
Name Type Description backend
String access_token
String - Source:
Returns:
- Type
- Promise
-
update(payload)
-
A convenience method for updating your account details.
Parameters:
Name Type Description payload
Object Properties
Name Type Description first_name
String last_name
String - Source:
Returns:
- Type
- Promise