lib

package
v0.0.0-...-76f7c0c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessSecretKey  = "verySecretKey"
	RefreshSecretKey = "anotherVerySecretKey"
	Issuer           = "AuthService"
)
View Source
const (
	EmailPattern string = "" /* 1208-byte string literal not displayed */
)

Variables

View Source
var (
	EmailRegex = regexp.MustCompile(EmailPattern)
)

Functions

func GenerateQRCode

func GenerateQRCode(email string) (image.Image, string, error)

func GenerateToken

func GenerateToken(email string, accessTokenDuration int64, refreshTokenDuration int64) (*pb.Token, error)

GenerateToken generates new JWT Access & Refresh tokens

func IsValidEmail

func IsValidEmail(value string) bool

func ValidateQRCode

func ValidateQRCode(code string, secret string) (bool, error)

Types

type JwtAccessClaims

type JwtAccessClaims struct {
	Email      string
	AccessUUID string
	jwt.StandardClaims
}

func ValidateAccessToken

func ValidateAccessToken(signedToken string) (*JwtAccessClaims, error)

ValidateAccessToken validates the JWT Access AccessToken

type JwtRefreshClaims

type JwtRefreshClaims struct {
	Email       string
	RefreshUUID string
	jwt.StandardClaims
}

func ValidateRefreshToken

func ValidateRefreshToken(signedToken string) (*JwtRefreshClaims, error)

Jump to

Keyboard shortcuts

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