helper

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogAndExit

func LogAndExit(message string, code int)

func StrPtr2Str

func StrPtr2Str(str *string) string

Types

type JwtClaims

type JwtClaims struct {
	UserId        int32  `json:"user_id"`
	Username      string `json:"username"`
	Authenticated bool   `json:"authenticated"`
	RefreshUUID   string `json:"refresh_uuid"` // If 2FA is enabled, this will be false until the user has authenticated with TOTP
	jwt.RegisteredClaims
}

func GetClaimsFromContext

func GetClaimsFromContext(c echo.Context) *JwtClaims

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	RefreshUUID  string
	AtExpires    *jwt.NumericDate
	RtExpires    *jwt.NumericDate
}

func GenerateToken

func GenerateToken(claims *JwtClaims) (*TokenDetails, error)

Jump to

Keyboard shortcuts

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