auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SessionNS session namespace
	SessionNS = "_pnk_squat"
)

Variables

This section is empty.

Functions

func BuildAuthCookie added in v0.2.0

func BuildAuthCookie(staffOnly bool, config *core.Configuration) func(next fasthttp.RequestHandler) fasthttp.RequestHandler

BuildAuthCookie factory for building middleware

func BuildAuthJWT added in v0.2.0

func BuildAuthJWT(secureAuthKey []byte) func(next fasthttp.RequestHandler) fasthttp.RequestHandler

BuildAuthJWT factory for building middleware

func ClearAuth

func ClearAuth(ctx *fasthttp.RequestCtx)

ClearAuth clears session and auth cookies

func NewJWT added in v0.2.0

func NewJWT(claims *UserClaims, secureAuthKey []byte) (string, error)

Types

type UserClaims added in v0.2.0

type UserClaims struct {
	jwt.RegisteredClaims
	ID       int64
	Username string
}

Jump to

Keyboard shortcuts

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