aboutsummaryrefslogblamecommitdiff
path: root/http_handle_login.go
blob: b60a71c934132b4df227d47d48fd862228be8d74 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11


            
             






                                                                                  
                                                                                 






                                       
package main

import (
	"fmt"
	"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 {
			fmt.Fprintln(w, "Error rendering template:", err.Error())
			return
		}
	}

	_ = r.PostFormValue("username")
	_ = r.PostFormValue("password")
}