This commit is contained in:
2026-06-09 14:40:49 +02:00
parent 918b9a6b74
commit b74df36bda

View File

@@ -30,6 +30,12 @@ func APIRegister(w http.ResponseWriter, r *http.Request) {
return
}
if len(user.Password) > 72 {
log.Println("POST [api/register] User password too long")
http.Error(w, "Password exceeds the maximum allowed length of 72 characters", http.StatusUnprocessableEntity)
return
}
hashed, err := auth.HashPassword(user.Password)
if err != nil {
log.Println("POST [api/register] " + r.RemoteAddr + ": " + err.Error())