Require user to provide current password to be able to change it
Admins can change other users' password without providing the current one, but not when changing their own
This commit is contained in:
@@ -18,6 +18,8 @@ type User struct {
|
||||
// This is used to set or change a password when calling Put. If it is empty, the password is not changed.
|
||||
// It is received from the UI with the name "password"
|
||||
NewPassword string `json:"password,omitempty"`
|
||||
// If changing the password, this is also required
|
||||
CurrentPassword string `json:"currentPassword,omitempty"`
|
||||
}
|
||||
|
||||
type Users []User
|
||||
|
||||
Reference in New Issue
Block a user