helper

package
v0.0.0-...-f10ba98 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJwtTokens

func GenerateJwtTokens(userId uuid.UUID, roleId *uuid.UUID) (*models.Token, error)

Generate access and refresh tokens

func MapTableName

func MapTableName(input string) (string, bool)

func ParseToken

func ParseToken(database *gorm.DB, tokenStr string) (*uuid.UUID, error)

Types

type UserAccessTokenClaims

type UserAccessTokenClaims struct {
	User      uuid.UUID         `json:"user"`
	Payload   map[string]string `json:"payload"`
	TokenType string            `json:"type"`
	Role      *uuid.UUID        `json:"role"`
	jwt.StandardClaims
}

type UserRefreshTokenClaims

type UserRefreshTokenClaims struct {
	User      uuid.UUID         `json:"user"`
	Payload   map[string]string `json:"payload"`
	TokenType string            `json:"type"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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