fix: password must at least 8 char in lenght
Docker Build and Push / Build and Push Docker Image (push) Successful in 13m23s

This commit is contained in:
2026-02-22 13:39:36 +07:00
parent 7eb25718db
commit fc98b94867
+5
View File
@@ -43,6 +43,11 @@ func (h *Handler) RegisterPost(w http.ResponseWriter, r *http.Request) {
return return
} }
if len(register.Password) < 8 {
badRequest(w, errors.New("password must be at least 8 characters long"))
return
}
hashedPassword, err := bcrypt.GenerateFromPassword( hashedPassword, err := bcrypt.GenerateFromPassword(
[]byte(register.Password), []byte(register.Password),
bcrypt.DefaultCost, bcrypt.DefaultCost,