feat(webui): add user account creation

This commit is contained in:
Julien Dessaux 2025-03-19 00:48:58 +01:00
parent 7abe963bfd
commit 26c5f9c5c7
Signed by: adyxax
GPG key ID: F92E51B86E07177E
7 changed files with 124 additions and 17 deletions

View file

@ -15,6 +15,8 @@ import (
var loginTemplate = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/login.html"))
var validUsername = regexp.MustCompile(`^[a-zA-Z]\w*$`)
type loginPage struct {
Page
Forbidden bool
@ -38,7 +40,6 @@ func handleLoginGET() http.Handler {
}
func handleLoginPOST(db *database.DB) http.Handler {
var validUsername = regexp.MustCompile(`^[a-zA-Z]\w*$`)
renderForbidden := func(w http.ResponseWriter, username string) {
render(w, loginTemplate, http.StatusForbidden, loginPage{
Page: Page{Title: "Login", Section: "login"},