auth

package
v0.0.0-...-47bc475 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtWrapper

type JwtWrapper struct {
	SecretKey         string // key used for signing the JWT token
	Issuer            string // Issuer of the JWT token
	ExpirationMinutes int64  // Number of minutes the JWT token will be valid for
	ExpirationHours   int64  // Expiration time of the JWT token in hours
}

func (*JwtWrapper) GenerateToken

func (j *JwtWrapper) GenerateToken(id int) (signedToken string, err error)

GenerateToken generates a jwt token

func (*JwtWrapper) RefreshToken

func (j *JwtWrapper) RefreshToken(id int) (signedtoken string, err error)

RefreshToken generates a refresh jwt token

func (*JwtWrapper) ValidateToken

func (j *JwtWrapper) ValidateToken(signedToken string) (claims *jwt.StandardClaims, err error)

ValidateToken validates the jwt token

Jump to

Keyboard shortcuts

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