helpers

package
v0.0.0-...-2c98600 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const JWT_VALID_TIME = 60 * 10 //seconds

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, passphrase string) (string, error)

func EncodeJWT

func EncodeJWT(userID uuid.UUID, profileConfirmed bool) (string, int64, error)

auth - creating auth JWT

func Encrypt

func Encrypt(t string, passphrase string) []byte

func RandString

func RandString(n int) string

Types

type Claims

type Claims struct {
	UserID           uuid.UUID
	ProfileConfirmed bool
	jwt.StandardClaims
}

Claims Create a struct that will be encoded to a JWT. We add jwt.StandardClaims as an embedded type, to provide fields like expiry time

func DecodeJWT

func DecodeJWT(tknStr string) (*Claims, error)

Jump to

Keyboard shortcuts

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