Constructor
new AuthServer(sdk, serverUrl, opts)
Create a new wallet server instance.
- Source:
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sdk |
ShelfNetwork
|
Parent SDK instance. |
|||||||||||||||||||||||||||||||||||
serverUrl |
string
|
wallet server URL. |
|||||||||||||||||||||||||||||||||||
opts |
Object
|
|
Methods
(async) changePassword(oldPassword, newPassword) → {Promise.<AuthServerResponse>}
Change the password.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
oldPassword |
string
|
Old user's password. |
newPassword |
string
|
Desired password. |
Returns:
- Type:
-
Promise.<AuthServerResponse>
(async) confirmRecovery(accountId, token, newPassword) → {Promise.<AuthServerResponse>}
Confirm the password recovery.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
accountId |
string
|
User's account ID. |
token |
string
|
Recovery token from the email. |
newPassword |
string
|
Desired password. |
Returns:
- Type:
-
Promise.<AuthServerResponse>
(async) createCredentials(password, accountIdopt) → {Promise.<AuthServerResponse>}
Create credentials.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
password |
string
|
Desired password. |
||
accountId |
string
|
<optional> |
null |
User's account ID. |
Returns:
- Type:
-
Promise.<AuthServerResponse>
(async) getToken(email, password, platformIdopt) → {Promise.<Token>}
Get a JWT token using credentials.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
email |
string
|
Email. |
||
password |
string
|
Password. |
||
platformId |
string
|
<optional> |
null |
User's platform ID. |
Returns:
- Type:
-
Promise.<Token>
(async) refreshToken(tokenopt) → {Promise.<Token>}
Refresh a JWT token.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
token |
string
|
<optional> |
JWT token to be refreshed. The token attached to the sdk instance will be used by default. |
Returns:
- Type:
-
Promise.<Token>
(async) requestRecovery(email) → {Promise.<AuthServerResponse>}
Request password recovery.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
email |
string
|
User's email. |
Returns:
- Type:
-
Promise.<AuthServerResponse>