support for users without a password to change their password

This commit is contained in:
MaysWind
2025-10-22 00:15:39 +08:00
parent a42c5fa988
commit 6395e3b5c1
5 changed files with 12 additions and 9 deletions
+1 -1
View File
@@ -277,7 +277,7 @@ func (a *UsersApi) UserUpdateProfileHandler(c *core.WebContext) (any, *errs.Erro
return nil, errs.ErrNotPermittedToPerformThisAction
}
if !a.users.IsPasswordEqualsUserPassword(userUpdateReq.OldPassword, user) {
if user.Password != "" && !a.users.IsPasswordEqualsUserPassword(userUpdateReq.OldPassword, user) {
return nil, errs.ErrUserPasswordWrong
}