Code-Cleanup: toter Check, none-Sentinel, Login-Jitter raus

- entry.go: redundantes stored != "" entfernt
- filepath-Sentinel "none" -> leerer String (Go-Zero-Value),
  Checks in entry.go/user.go und web/js/app.js vereinfacht
- auth.go: zufaelligen Login-Jitter samt loginJitter-Variable und
  Test-Seam entfernt (war nur Spielerei, kein echter Schutz)
- notes/migrations.md: einmalige "none"->"" Migration dokumentiert

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 11:33:41 +02:00
parent bee1305a2b
commit e210df3e2e
6 changed files with 29 additions and 18 deletions
+3 -3
View File
@@ -75,16 +75,16 @@ func handleCreateEntry(w http.ResponseWriter, r *http.Request) {
content = content[:1000]
}
filepath := "none"
filepath := ""
if r.MultipartForm != nil {
if files := r.MultipartForm.File["file"]; len(files) > 0 {
if stored, err := storeImage(files[0]); err == nil && stored != "" {
if stored, err := storeImage(files[0]); err == nil {
filepath = stored
}
}
}
if filepath == "none" && content == "" {
if filepath == "" && content == "" {
writeError(w, http.StatusBadRequest, "Leerer Beitrag!")
return
}