fetchAuth
Constants
- doSignIn ⇒
Promise.<Object>
Sign in a user.
- doSignUp ⇒
Promise.<Object>
Sign up a new user.
- confirmCode ⇒
Promise.<Object>
Confirm the verification code.
- resendCode ⇒
Promise.<Object>
Resend the verification code.
- fetchUser ⇒
Promise.<Object>
Fetch the user data.
- recoverPasswordEmail ⇒
Promise.<Object>
Recover the password via email.
- recoverPassword ⇒
Promise.<Object>
Recover the password.
- editProfile ⇒
Promise.<Object>
Edit the user profile.
- fetchUserById ⇒
Promise.<Object>
Fetch a user by id.
- follow ⇒
Promise.<Object>
Follow a user.
- unfollow ⇒
Promise.<Object>
Unfollow a user.
- fetchFollowersById ⇒
Promise.<Object>
Fetch followers by id.
- fetchFollowingById ⇒
Promise.<Object>
Fetch following by id.
- changeRoleStatus ⇒
Promise.<Object>
Change the role status of a user.
- signUpIdp ⇒
Promise.<Object>
Sign up a user with an identity provider.
doSignIn ⇒ Promise.<Object>
Sign in a user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
user | Object | The user data. |
doSignUp ⇒ Promise.<Object>
Sign up a new user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 201.
Param | Type | Description |
---|---|---|
user | Object | The user data. |
photo | File | The user's photo. |
confirmCode ⇒ Promise.<Object>
Confirm the verification code.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
username | string | The username of the user. |
code | string | The verification code. |
resendCode ⇒ Promise.<Object>
Resend the verification code.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
string | The email of the user. |
fetchUser ⇒ Promise.<Object>
Fetch the user data.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
recoverPasswordEmail ⇒ Promise.<Object>
Recover the password via email.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
string | The email of the user. |
recoverPassword ⇒ Promise.<Object>
Recover the password.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
string | The email of the user. | |
code | string | The verification code. |
password | string | The new password. |
editProfile ⇒ Promise.<Object>
Edit the user profile.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
id | string | The id of the user. |
name | string | The new name of the user. |
username | string | The new username of the user. |
string | The new email of the user. | |
city | string | The new city of the user. |
region | string | The new region of the user. |
photo | File | The new photo of the user. |
fetchUserById ⇒ Promise.<Object>
Fetch a user by id.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
id | string | The id of the user. |
follow ⇒ Promise.<Object>
Follow a user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
id | string | The id of the user to follow. |
unfollow ⇒ Promise.<Object>
Unfollow a user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
id | string | The id of the user to unfollow. |
fetchFollowersById ⇒ Promise.<Object>
Fetch followers by id.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
sort | string | The sort order. |
fetchFollowingById ⇒ Promise.<Object>
Fetch following by id.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
sort | string | The sort order. |
changeRoleStatus ⇒ Promise.<Object>
Change the role status of a user.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 200.
Param | Type | Description |
---|---|---|
token | string | The authorization token. |
role | string | The new role of the user. |
signUpIdp ⇒ Promise.<Object>
Sign up a user with an identity provider.
Kind: global constant
Returns: Promise.<Object>
- The response data.
Throws:
Error
If the response status is not 201.
Param | Type | Description |
---|---|---|
name | string | The name of the user. |
username | string | The username of the user. |
string | The email of the user. | |
city | string | The city of the user. |
region | string | The region of the user. |
photo | string | The photo of the user. |