token

package
v0.0.0-...-771bf79 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT(objectId string, username, email string, roles []string) (string, error)

func GetIDFromJWT

func GetIDFromJWT(tokenString string) (string, error)

Types

type CustomClaims

type CustomClaims struct {
	ObjectId string   `json:"objectId"`
	Username string   `json:"username"`
	Email    string   `json:"email"`
	Roles    []string `json:"roles"`
	jwt.RegisteredClaims
}

Struct for custom claims

func ParseJWT

func ParseJWT(tokenString string) (*CustomClaims, error)

Jump to

Keyboard shortcuts

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