mirror of
https://github.com/MengMengCode/VoCat.git
synced 2026-08-22 15:53:43 +08:00
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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user