aboutsummaryrefslogtreecommitdiff
path: root/http_handle_login.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-13 01:52:16 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-13 01:52:16 +0800
commitb2f5ebdc623c5cf278215ef2da0ecefaba2f5d65 (patch)
tree08be901cc463e45418e3ffff3d0b3be16ff27f23 /http_handle_login.go
parent_header.html: Add header (diff)
downloadforge-b2f5ebdc623c5cf278215ef2da0ecefaba2f5d65.tar.gz
forge-b2f5ebdc623c5cf278215ef2da0ecefaba2f5d65.tar.zst
forge-b2f5ebdc623c5cf278215ef2da0ecefaba2f5d65.zip
login: Stub login page
Diffstat (limited to 'http_handle_login.go')
-rw-r--r--http_handle_login.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/http_handle_login.go b/http_handle_login.go
new file mode 100644
index 0000000..ef094f1
--- /dev/null
+++ b/http_handle_login.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "net/http"
+)
+
+func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any) {
+ if r.Method != "POST" {
+ err := templates.ExecuteTemplate(w, "login", params)
+ if err != nil {
+ _, _ = w.Write([]byte("Error rendering template: " + err.Error()))
+ return
+ }
+ }
+
+ _ = r.PostFormValue("username")
+ _ = r.PostFormValue("password")
+}