session

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2018 License: MIT Imports: 9 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthenticity

func CheckAuthenticity(w http.ResponseWriter, r *http.Request) error

CheckAuthenticity checks the authenticity token in params against cookie - The masked token is inserted into forms and POSTS by js. The token is inserted into the cookie by the middleware above. This is a shortcut for where you don't need params otherwise.

func CurrentUser

func CurrentUser(w http.ResponseWriter, r *http.Request) *users.User

CurrentUser returns the saved user (or an empty anon user) for the current session cookie

func Middleware

func Middleware(h http.HandlerFunc) http.HandlerFunc

Middleware sets a token on every GET request so that it can be inserted into the view. It currently ignores requests for files and assets.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL