Пример #1
0
// PostLoginHandler ...
func PostLoginHandler(rnd render.Render, r *http.Request, s *session.Session) {
	username := r.FormValue("username")
	password := r.FormValue("password")

	fmt.Println(username)
	fmt.Println(password)

	s.Username = username
	s.IsAuthorized = true

	rnd.Redirect("/")
}
Пример #2
0
// LogoutHandler ...
func LogoutHandler(rnd render.Render, r *http.Request, s *session.Session) {
	s.Username = ""
	s.IsAuthorized = false

	rnd.Redirect("/")
}