Documentation
¶
Overview ¶
Package helper provides helper functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StrPtr2Str ¶
Types ¶
type JwtClaims ¶
type JwtClaims struct {
UserId int32 `json:"user_id"`
Username string `json:"username"`
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)
type Validator ¶ added in v0.0.2
type Validator struct {
// contains filtered or unexported fields
}
Validator is a wrapper around the validator package
func NewValidator ¶ added in v0.0.2
func NewValidator() *Validator
NewValidator returns a new Validator
Click to show internal directories.
Click to hide internal directories.