Exemplo n.º 1
0
func hLogout(w http.ResponseWriter, req *http.Request) {
	session := data.GetSession(req)
	log.Printf("%s [%s]", req.URL, session.Id)
	if session != nil {
		session.User = nil
	}
	http.Redirect(w, req, "/", http.StatusSeeOther)
}
Exemplo n.º 2
0
func hRegister(w http.ResponseWriter, req *http.Request) {
	session := data.GetSession(req)
	log.Printf("%s [%s]", req.URL, session.Id)
	if req.URL.Path != "/register" {
		NotFound(w, req)
		return
	}
	NotFound(w, req)
}