Module vweb.csrf stdlib

vweb.csrf
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
3
Imported by:
0
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

This section is empty.

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

This section is empty.

Structs

#struct App

pub struct App {
	vweb.Context
	csrf_cookie_value string
}

#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.

#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) check_headers

fn (app App) check_headers(app_csrf_cookie_str string) bool

check_headers - checks if there is a CSRF-Token that was sent with the headers of a request

#struct HttpOnly

pub struct HttpOnly {
	http_only bool
}

Interfaces

This section is empty.

Enums

This section is empty.