Skip to content

vweb.csrf #

struct App #

struct App {
	vweb.Context
	csrf_cookie_value string
}

fn (App) csrf_protect #

fn (mut app App) csrf_protect() CheckedApp

csrf_protect - protects a handler-function against CSRF. Should be set at the beginning of the handler-function.

fn (App) get_csrf_token #

fn (mut app App) get_csrf_token() ?string

get_csrf_token - returns the CSRF-Token that has been set. Make sure that you set one by using set_csrf_cookie(). If it's value is empty or no cookie has been generated, the function will throw an error.

struct HttpOnly #

struct HttpOnly {
	http_only bool
}