Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateQRCode(email string) (image.Image, string, error)
- func GenerateToken(email string, accessTokenDuration int64, refreshTokenDuration int64) (*pb.Token, error)
- func IsValidEmail(value string) bool
- func ValidateQRCode(code string, secret string) (bool, error)
- type JwtAccessClaims
- type JwtRefreshClaims
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 GenerateToken ¶
func GenerateToken(email string, accessTokenDuration int64, refreshTokenDuration int64) (*pb.Token, error)
GenerateToken generates new JWT Access & Refresh tokens
func IsValidEmail ¶
Types ¶
type JwtAccessClaims ¶
func ValidateAccessToken ¶
func ValidateAccessToken(signedToken string) (*JwtAccessClaims, error)
ValidateAccessToken validates the JWT Access AccessToken
type JwtRefreshClaims ¶
func ValidateRefreshToken ¶
func ValidateRefreshToken(signedToken string) (*JwtRefreshClaims, error)
Click to show internal directories.
Click to hide internal directories.