diff options
author | Julien Dessaux | 2025-01-26 00:04:38 +0100 |
---|---|---|
committer | Julien Dessaux | 2025-01-26 00:04:38 +0100 |
commit | 4e029fb83a1e70495330eaac94981a97de24682e (patch) | |
tree | fb041970dcbf38daf06de5034cf6fd567c586069 /pkg/webui/login.go | |
parent | feat(webui): implement states list (diff) | |
download | tfstated-4e029fb83a1e70495330eaac94981a97de24682e.tar.gz tfstated-4e029fb83a1e70495330eaac94981a97de24682e.tar.bz2 tfstated-4e029fb83a1e70495330eaac94981a97de24682e.zip |
feat(webui): bootstrap a proper UI
Diffstat (limited to 'pkg/webui/login.go')
-rw-r--r-- | pkg/webui/login.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/webui/login.go b/pkg/webui/login.go index 8444e2c..6f688c1 100644 --- a/pkg/webui/login.go +++ b/pkg/webui/login.go @@ -14,6 +14,7 @@ import ( var loginTemplate = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/login.html")) type loginPage struct { + Page Forbidden bool Username string } @@ -28,7 +29,9 @@ func handleLoginGET() http.Handler { return } - render(w, loginTemplate, http.StatusOK, loginPage{}) + render(w, loginTemplate, http.StatusOK, loginPage{ + Page: Page{Title: "Login", Section: "login"}, + }) }) } @@ -36,6 +39,7 @@ 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"}, Forbidden: true, Username: username, }) |