jwt

package
v0.0.0-...-c4c9469 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SecretKey = []byte("secret")
)

secret key being used to sign tokens

Functions

func GenerateToken

func GenerateToken(username string) (string, error)

GenerateToken generates a jwt token and assign a username to it's claims and return it

func ParseToken

func ParseToken(tokenStr string) (string, error)

ParseToken parses a jwt token and returns the username it it's claims

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	// contains filtered or unexported fields
}

data we save in each token

Jump to

Keyboard shortcuts

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