feat(webui): add password reset page
All checks were successful
main / main (push) Successful in 1m49s
main / deploy (push) Has been skipped
main / publish (push) Has been skipped

#20
This commit is contained in:
Julien Dessaux 2025-04-20 15:33:07 +02:00
parent bb11b870d6
commit 922112e181
Signed by: adyxax
GPG key ID: F92E51B86E07177E
7 changed files with 181 additions and 3 deletions

View file

@ -3,7 +3,6 @@ package webui
import (
"context"
"encoding/json"
"fmt"
"html/template"
"log/slog"
"net/http"
@ -55,8 +54,8 @@ func handleLoginPOST(db *database.DB) http.Handler {
username := r.FormValue("username")
password := r.FormValue("password")
if username == "" || password == "" { // the webui cannot issue this
errorResponse(w, r, http.StatusBadRequest, fmt.Errorf("Forbidden"))
if username == "" || password == "" {
errorResponse(w, r, http.StatusBadRequest, nil)
return
}
if ok := validUsername.MatchString(username); !ok {