mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-12-03 06:22:32 -05:00
extend POST /users/:id
Now you can set a password for a user while the server is running,
e.g. via the following command:
```shell
curl \
-H 'Content-Type: application/json' \
-d '{"update": {"password": "asdf"}}' \
--unix-socket /var/lib/moonfire-nvr/sock \
http://nvr/api/users/1
```
This commit is contained in:
@@ -2034,6 +2034,10 @@ impl LockedDatabase {
|
||||
self.auth.users_by_id()
|
||||
}
|
||||
|
||||
pub fn get_user_by_id_mut(&mut self, id: i32) -> Option<&mut User> {
|
||||
self.auth.get_user_by_id_mut(id)
|
||||
}
|
||||
|
||||
pub fn apply_user_change(&mut self, change: UserChange) -> Result<&User, Error> {
|
||||
self.auth.apply(&self.conn, change)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user