1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-11-29 11:50:22 +01:00

user: Allow changing the hashed password directly

This adds the detection of `NTFY_PASSWORD_HASH` when creating a user or
changing its passsword so that scripts don't have to manipulate the bare
password.
This commit is contained in:
Tom Hubrecht 2025-05-20 10:49:26 +02:00
parent 630f2957de
commit 44b7c2f198
No known key found for this signature in database
11 changed files with 144 additions and 107 deletions

View file

@ -60,7 +60,7 @@ func (s *Server) handleUsersAdd(w http.ResponseWriter, r *http.Request, v *visit
return err
}
}
if err := s.userManager.AddUser(req.Username, req.Password, user.RoleUser); err != nil {
if err := s.userManager.AddUser(req.Username, req.Password, user.RoleUser, false); err != nil {
return err
}
if tier != nil {