Beispiel #1
0
//ValidateCSRF validates csrf token for request
func ValidateCSRF(request prago.Request) {
	token := CSRFToken(request)
	if len(token) == 0 {
		panic("token not set")
	}
	paramsToken := request.Params().Get("_csrfToken")
	if paramsToken != token {
		panic("Wrong CSRF token")
	}
}
Beispiel #2
0
func Newsletter(request prago.Request) {
	email := request.Params().Get("email")
	println(email)
	prago.Redirect(request, "/index.html?submitted")
}