Add a script to reset a password and update docs

This commit is contained in:
Eike Kettner
2021-01-04 16:58:55 +01:00
parent 668abf2140
commit 951623375c
3 changed files with 87 additions and 0 deletions

View File

@ -41,6 +41,8 @@ a "normal" http header. If a cookie header is used, the cookie name
must be `docspell_auth` and a custom header must be named
`X-Docspell-Auth`.
The admin route (see below) `/admin/user/resetPassword` can be used to
reset a password of a user.
## Admin

View File

@ -0,0 +1,39 @@
+++
title = "Reset Password"
description = "Resets a user password."
weight = 70
+++
This script can be used to reset a user password. This can be done by
admins, who know the `admin-endpoint.secret` value in the
[configuration](@/docs/configure/_index.md#admin-endpoint) file.
The script is in `/tools/reset-password/reset-password.sh` and it is
only a wrapper around the admin endpoint `/admin/user/resetPassword`.
## Usage
It's very simple:
``` bash
reset-password.sh <base-url> <admin-secret> <account>
```
Three arguments are required to specify the docspell base url, the
admin secret and the account you want to reset the password.
After the password has been reset, the user can login using it and
change it again in the webapp.
## Example
``` json
./tools/reset-password/reset-password.sh http://localhost:7880 123 eike
{
"success": true,
"newPassword": "HjtpG9BFo9y",
"message": "Password updated"
}
```