doc: added documentation for the path

This commit is contained in:
silver 2023-07-30 23:22:40 +01:00
parent bfe96f0f2c
commit 04853f439b
2 changed files with 45 additions and 2 deletions

View file

@ -54,6 +54,49 @@ Invalid Auth:
Generic responses which is used unless otherwise specified above.
### POST /ldap/reset
```json
{
"user" : "[OPTIONAL] username looking for reset",
"email" : "[OPTIONAL] email looking for reset"
}
```
All responses:
```json
{"result": "success"}
```
### POST /ldap/reset/auth
```json
{
"auth" : "Auth key from teh email",
"pass" : "Password the user chooses"
}
```
Early Errors:
```json
{"result": "error"}
```
LDAP error:
```json
{"result": "error", "error": "ldap error"}
```
Success:
```json
{"result": "success", "success": "Password set"}
```
## Responses
Generic responses which is used unless otherwise specified above.
### Success: HTTP 200
```json
{

View file

@ -87,13 +87,13 @@ pub async fn post_password_auth(mut req: Request<State>) -> tide::Result {
let db = &req.state().db;
if db_pending_clear_expired(db).await.is_err() {
return Ok(json!({"result": "success"}).into());
return Ok(json!({"result": "error"}).into());
}
// check if auth exists
let details = match db_get_user_reset_auth(db, &auth).await {
None => {
return Ok(json!({"result": "success"}).into());
return Ok(json!({"result": "error"}).into());
}
Some(x) => x,
};