cookie

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedirectCookie = "tanuki-redirect"

Functions

func Admin

func Admin(home string) gin.HandlerFunc

Admin Middleware which ensures the user accessing the route must be an admin, should be called after CookieEnsureAuthed

func Auth

func Auth(s *server.Instance, action Action) gin.HandlerFunc

Auth middleware which ensures the user is authorised

func SkipIfAuthed

func SkipIfAuthed(session *auth.Session, home string) gin.HandlerFunc

SkipIfAuthed Middleware which skips these routes if the user is already authorised and redirect to the home page instead

Types

type Action added in v0.12.1

type Action int
const (
	Redirect Action = iota
	Abort
)

Jump to

Keyboard shortcuts

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