Updated documentation

This commit is contained in:
2021-08-21 22:45:15 +01:00
parent 0da150f471
commit 02387914a8
+48 -10
View File
@@ -20,10 +20,16 @@ Content-Type: application/json
}
//DOCS: Used for validating the email address above
###
//DOCS: Used for validating the email address specified above
GET /auth/validation?username=example&token=12345678
###
//DOCS: Login after validation
POST /auth/login
Content-Type: application/json
@@ -33,14 +39,17 @@ Content-Type: application/json
"password": "helloworld"
}
//Result (access token's value is your authorization key below)
//DOCS: Result (access token's value is your authorization key below)
{
"accessToken": "abcde",
"refreshToken": "fghij"
}
//DOCS: Replace an expired authToken pair with these values
###
//DOCS: Replace an expired authToken pair with new values
POST /auth/token
Content-Type: application/json
@@ -48,6 +57,15 @@ Content-Type: application/json
"token": "refreshToken"
}
//DOCS: Result
{
"accessToken": "abcde",
"refreshToken": "fghij"
}
###
//DOCS: After this is called, the refresh route will no longer work
DELETE /auth/logout
@@ -58,22 +76,30 @@ Authorization: Bearer accessToken
}
###
//DOCS: Retreives the private account data, results vary
GET /auth/account
Authorization: Bearer accessToken
//Result
{
"accessToken": "abcde",
"refreshToken": "fghij"
}
###
//DOCS: Update account data, input varies, but is always JSON
//DOCS: Update account data
PATCH /auth/account
Content-Type: application/json
Authorization: Bearer accessToken
{
"password": "helloworld",
"contact": true
}
###
//DOCS: Sets the timer, account will be deleted after 2 days
DELETE /auth/account
@@ -85,6 +111,9 @@ Content-Type: application/json
}
###
//DOCS: Send the link to recover a forgotten password
POST /auth/recover
Content-Type: application/json
@@ -94,17 +123,26 @@ Content-Type: application/json
}
###
//DOCS: Redirect the link to recover a password to the front-end
GET /auth/reset?token=<token>
//Result
//DOCS: Result
301 -> ${WEB_RESET_ADDRESS}?email=<email>&token=<token>
###
//DOCS: Resets a password for the given email, correct token is required
PATCH /auth/reset?email=<email>&token=<token>
{
"password": "password"
}
###
```