Exemple #1
0
func (rcv *controller) serve() {
	rcv.formUser = &account{Controller: rcv.Controller}
	rcv.loggedUser = auth.GetSignedInUser(rcv.Request)
	rcv.SetTitle("text03", rcv.loggedUser.Name)

	switch rcv.Request.Method {
	case "GET":
		rcv.get()
	case "POST":

		errs := rcv.put()
		if errs == nil {
			auth.SignOut(rcv.Response, rcv.Request)
			return

		}

		for _, e := range errs {
			rcv.AppendError(e)
		}
		rcv.get()

	}
	rcv.Render()
}
Exemple #2
0
func (rcv *controller) serve() {

	rcv.loggedUser = auth.GetSignedInUser(rcv.Request)
	rcv.SetTitle("text02", rcv.loggedUser.Name)

	switch rcv.Request.Method {
	case "POST":
		auth.SignOut(rcv.Response, rcv.Request)
		if err := rcv.delete(); err != nil {
			rcv.SetFlash("E", "text20")
			rcv.Redirect("/", 303)
			return
		}
		rcv.SetFlash("I", "text21")
		rcv.Redirect("/", 303)
	}

}