-
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 confirming recover token
- Loading branch information
1 parent
24a7c81
commit c333430
Showing
2 changed files
with
89 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
id: token | ||
title: Confirm Recovery Token | ||
sidebar_label: Confirm Recovery Token | ||
slug: /auth/token | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
import Highlight from "../../src/highlight.js" | ||
|
||
## Details | ||
|
||
This endpoint is used to check if the given token is valid to recover an account. | ||
The token can be generated by using the [recover](./recover.md) endpoint and is sent to the user by email. | ||
|
||
**URL** : `/auth/recover/:token/confirm` | ||
|
||
**Method** : <Highlight level="info" inline>GET</Highlight> | ||
|
||
## 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"> | ||
|
||
```bash | ||
/auth/recover/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im5pQGFlZmV1cC5wdCIsImlhdCI6MTY2MzAxMzg0OSwiZXhwIjoxNjYzMDE0NDQ5fQ.k5Z_nBpqt_Hs8JBhLH0ZXTl2-BG-utdIAUdhKXEFuFc/confirm | ||
``` | ||
|
||
</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> |