jwt

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvaildToken     = fmt.Errorf("invalid token")
	ErrNoTokenInRequest = fmt.Errorf("no token in request")
)

Functions

func GenerateToken

func GenerateToken(sessionId string) (string, error)

func GetSessionIdFromToken

func GetSessionIdFromToken(request *http.Request) (sessionId string, err error)

GetSessionIdFromToken extracts sessionId from http.Request Auth header

func Parse

func Parse(tokenStr string) (string, error)

Types

type Claims

type Claims struct {
	jwt.RegisteredClaims
	SessionId string `json:"sessionId"`
}

Jump to

Keyboard shortcuts

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