Feat/admin credentials pr limit (#19)

* feat: reset admin credentials without requiring current password and update related prompts

* feat: update password requirements to a minimum of 6 characters for admin credentials
This commit is contained in:
Meng Meng
2026-08-14 21:52:53 +08:00
committed by GitHub
parent 4b1bcdf582
commit fcf57ffec9
5 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -506,7 +506,7 @@ func (s *Server) handlePasswordChange(w http.ResponseWriter, r *http.Request) {
switch {
case errors.Is(err, auth.ErrInvalidCredentials):
writeError(w, http.StatusUnauthorized, "invalid_credentials", "current password is incorrect")
case strings.Contains(err.Error(), "between 12 and 1024"):
case strings.Contains(err.Error(), "between 6 and 1024"):
writeError(w, http.StatusBadRequest, "weak_password", err.Error())
case strings.Contains(err.Error(), "must differ"):
writeError(w, http.StatusBadRequest, "password_reused", err.Error())