token

package
v0.0.0-...-242d932 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserId

func GetUserId(token string) (string, *errors.ApplicationError)

func SetToken

func SetToken(token *Model) *errors.ApplicationError

func ValidateToken

func ValidateToken(tokenString string, tokenType string) *errors.ApplicationError

func VerifyToken

func VerifyToken(tokenString string, tokenType string) (*jwt.Token, error)

Types

type Model

type Model struct {
	Token   string
	Uuid    string
	Expires int64
	UserId  string
}

func CreateAccessToken

func CreateAccessToken(userId string) (*Model, *errors.ApplicationError)

func CreateRefreshToken

func CreateRefreshToken(userId string) (*Model, *errors.ApplicationError)

func ExtractTokenClaims

func ExtractTokenClaims(tokenString string, tokenType string) (*Model, *errors.ApplicationError)

type Response

type Response struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
}

Jump to

Keyboard shortcuts

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