mirror of
https://github.com/iv-org/documentation.git
synced 2025-05-02 14:56:21 -04:00
add instructions for resetting password (#374)
This commit is contained in:
parent
d9af00b09d
commit
15eef0af6f
3 changed files with 28 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
- [Database Information and Maintenance](./db-maintenance.md)
|
||||
- [Issues with CAPTCHA](./captcha-bug.md)
|
||||
- [How to setup Anti-Captcha](./anti-captcha.md)
|
||||
- [How to reset a user's password](./reset-pass.md)
|
||||
|
||||
## For Developers
|
||||
|
||||
|
|
25
docs/reset-pass.md
Normal file
25
docs/reset-pass.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# How to reset a user's password
|
||||
|
||||
Resetting a user's invidious password needs you to edit the database.
|
||||
|
||||
Firstly, generate a bcrypt-encrypted hash for the new password you want to set for the user.
|
||||
|
||||
This can be done with the `bcrypt` python module, though there are other ways of doing the same.
|
||||
|
||||
```
|
||||
python3 -c 'import bcrypt; print(bcrypt.hashpw(b"<INSERT PASSWORD HERE>", bcrypt.gensalt(rounds=10)).decode("ascii"))'
|
||||
```
|
||||
|
||||
To do so, first attach to the database:
|
||||
```
|
||||
# su - postgres
|
||||
$ psql
|
||||
postgres=# \c invidious
|
||||
```
|
||||
|
||||
Now, run the following SQL query:
|
||||
```
|
||||
UPDATE users SET password = 'HASH' WHERE email = 'USERNAME';
|
||||
```
|
||||
|
||||
After that, the password should be reset.
|
Loading…
Add table
Add a link
Reference in a new issue