common

package
v0.0.0-...-e954c25 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Common parts used in other views

Index

Constants

This section is empty.

Variables

View Source
var JwtTokenAuth = jwtauth.New("HS256", []byte(config.Get().JWTSecret), nil)

Functions

func LoginThrottle

func LoginThrottle(next http.Handler) http.Handler

Progressive pause on loading auth page if password was wrong. You have to set login value to a Context by a key "throttle_login" when auth failed. Or just send credentials as "login", "password" form values.

func Session

func Session(next http.Handler) http.Handler

Gets JWT claims and save it to context by "session" name Usage: {{.context.Value "session" }} {{with .context.Value "session"}}{{ .admin_login }}{{end}}

Types

This section is empty.

Jump to

Keyboard shortcuts

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