func auth(w http.ResponseWriter, r *http.Request) {
	f := forms.Form{Fields: FFlogin}
	f.Data = r.Form
	if !f.IsValid() {
		ecntx := reflect.Copy(r.Form)
		es := make([]string, len(f.Errors))
		x := 0
		for k, e := range f.Errors {
			delete(ecntx, k)
			es[x] = e
		}
		ecntx["no_auth_error"] = strings.Join(es, ", ")
		delete(ecntx, "password")
		return login(w, r, ecntx)
	}
	s := do_login(f.CleanedData)
	switch s {
	case nil:
		http.Redirect(w, r, REDIRECT_URL, http.StatusFound)
	case E_AUTH_Deny:
		fallthrough
	case E_AUTH_Expired:
		fallthrough
	case E_AUTH_Blacklist:
		fallthrough
		ecntx := reflect.Copy(r.Form)
		ecntx["no_auth_error"] = s.Error()
		delete(ecntx, "password")
		return login(w, r, ecntx)
	}
}
Authenticate (handle: POST)
package captive
import (
	"github.com/MartinBrugnara/goforms/forms"
	"html/template"
	"net/http"
	"reflect"
)
func splash(w http.ResponseWriter, r *http.Request) {
	login(w, r, nil)
}