jwt

package
v0.0.0-...-8ba40cc Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(secret []byte, typ AuthType) func(next http.Handler) http.Handler

func New

func New(user *app.User, secret []byte) (string, error)

Types

type AuthType

type AuthType int
const (
	AuthTypeRequired AuthType = iota
	AuthTypeOptional
)

type TokenClaims

type TokenClaims struct {
	User *app.User `json:"user"`
}

func Parse

func Parse(token string, secret []byte) (*TokenClaims, error)

func (TokenClaims) Valid

func (t TokenClaims) Valid() error

Jump to

Keyboard shortcuts

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