diff options
Diffstat (limited to 'http_handle_login.go')
-rw-r--r-- | http_handle_login.go | 18 |
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") +} |