-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation page for finishing password recovery
- Loading branch information
1 parent
c333430
commit 4779cba
Showing
4 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
--- | ||
id: finish-recovery | ||
title: Finish Password Recovery | ||
sidebar_label: Finish Password Recovery | ||
slug: /auth/finish-recovery | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
import Highlight from "../../src/highlight.js" | ||
|
||
## Details | ||
|
||
This endpoint is used to change the password of an account, given a previously generated token. | ||
The token can be generated by using the [recover](./recover) endpoint and is sent to the user by email. | ||
|
||
**URL** : `/auth/recover/:token/confirm` | ||
|
||
**Method** : <Highlight level="info" inline>POST</Highlight> | ||
|
||
## Parameters | ||
|
||
### password | ||
|
||
<Highlight level="info" inline>Body Parameter</Highlight> | ||
<Highlight level="danger" inline>Required</Highlight> | ||
<br/> | ||
<Highlight level="secondary" inline>String</Highlight> | ||
<Highlight level="warning" inline>Min Length: 8</Highlight> | ||
|
||
New password for the account. Must contain at least one number. | ||
|
||
## Request examples | ||
|
||
### Example 1 - Valid Token | ||
|
||
**Code** : <Highlight level="success" inline>200 OK</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```json | ||
{ | ||
"password": "newpassword123" | ||
} | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Example 2 - Invalid Token | ||
|
||
**Code** : <Highlight level="danger" inline>403 FORBIDDEN</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```bash | ||
/auth/recover/invalid/confirm | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{ | ||
"error_code": 3, | ||
"errors": [ | ||
{ | ||
"msg": "invalid-token" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Example 3 - Password Without Numbers | ||
|
||
**Code** : <Highlight level="danger" inline>422 UNPROCESSABLE ENTITY</Highlight> | ||
|
||
<Tabs | ||
defaultValue="request" | ||
values={[ | ||
{label: 'Request', value: 'request'}, | ||
{label: 'Response', value: 'response'}, | ||
]} | ||
> | ||
<TabItem value="request"> | ||
|
||
```json | ||
{ | ||
"password": "newpassword" | ||
} | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="response"> | ||
|
||
```json | ||
{ | ||
"error_code": 1, | ||
"errors": [ | ||
{ | ||
"value": "newpassword", | ||
"msg": "must-contain-number", | ||
"param": "password", | ||
"location": "body" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters