mirror of
https://github.com/pushbits/server.git
synced 2025-07-12 14:17:29 +02:00
Add option to check for weak passwords
This commit is contained in:
parent
ad56422838
commit
b06bd51d21
12 changed files with 141 additions and 15 deletions
|
@ -90,7 +90,12 @@ func (h *UserHandler) updateUser(ctx *gin.Context, u *model.User, updateUser mod
|
|||
u.Name = *updateUser.Name
|
||||
}
|
||||
if updateUser.Password != nil {
|
||||
u.PasswordHash = h.CM.CreatePasswordHash(*updateUser.Password)
|
||||
hash, err := h.CM.CreatePasswordHash(*updateUser.Password)
|
||||
if success := successOrAbort(ctx, http.StatusBadRequest, err); !success {
|
||||
return err
|
||||
}
|
||||
|
||||
u.PasswordHash = hash
|
||||
}
|
||||
if updateUser.MatrixID != nil {
|
||||
u.MatrixID = *updateUser.MatrixID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue