Documentation
¶
Index ¶
- Constants
- Variables
- func CheckPasswordHash(password, hash string) bool
- func GenerateTokens(userId pgtype.UUID) (accessToken string, refreshToken string, err error)
- func HashPassword(password string) (string, error)
- func IsTokenExpired(claims *CustomClaims) bool
- func LoadEnv()
- type Credentials
- type CustomClaims
Constants ¶
View Source
const AccessTokenKey = "access_token"
Variables ¶
View Source
var ( TimeFiveMinutes = time.Now().Add(5 * time.Minute) TimeOneMonth = time.Now().Add(30 * 24 * time.Hour) )
move to const time variables
Functions ¶
func CheckPasswordHash ¶
func GenerateTokens ¶
func HashPassword ¶
func IsTokenExpired ¶
func IsTokenExpired(claims *CustomClaims) bool
Types ¶
type Credentials ¶
func GetValidCredentials ¶
func GetValidCredentials(c fiber.Ctx) (*Credentials, error)
type CustomClaims ¶
type CustomClaims struct { jwt.RegisteredClaims Exp string `json:"exp"` UserId pgtype.UUID `json:"userId"` }
func ValidateToken ¶
func ValidateToken(tokenStr string) (*CustomClaims, error)
Click to show internal directories.
Click to hide internal directories.