func userLoginForm(w http.ResponseWriter, r *http.Request) { s := session.Get(w, r) if s.IsAuthenticated() { fmt.Fprintln(w, "You are authed!") } template.Get("user/login").Render(w, "") }
func userLoginSubmit(w http.ResponseWriter, r *http.Request) { user := new(User) user.fromRequest(r) if !user.passwordOk() { fmt.Fprintln(w, "bad password dude") } session.Get(w, r).Authenticate() route.Redirect(w, r, "meat.list") }
func userLogout(w http.ResponseWriter, r *http.Request) { session.Get(w, r).Logout() route.Redirect(w, r, "user.login") }