jwt

package
v0.0.0-...-fb80190 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT(userID uint, username string) (string, error)

func GenerateLongLivedJWT

func GenerateLongLivedJWT(userID uint, username string, days int) (string, error)

func RefreshJWT

func RefreshJWT(refreshToken string) (string, error)

Types

type Claims

type Claims struct {
	UserID   uint   `json:"user_id"`
	Username string `json:"username"`
	jwt.RegisteredClaims
}

func ValidateJWT

func ValidateJWT(tokenStr string) (*Claims, error)

Jump to

Keyboard shortcuts

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