auth

package
v0.0.0-...-72e8ceb Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(userID uint) (string, error)

GenerateToken generates a JWT token with the user ID as part of the claims

func GenerateTokenAndSetCookies

func GenerateTokenAndSetCookies(user *domain.User, c echo.Context) error

func GetJWTSecret

func GetJWTSecret() string

func GetRefreshJWTSecret

func GetRefreshJWTSecret() string

func JWTErrorChecker

func JWTErrorChecker(err error, c echo.Context) error

func TokenRefresherMiddleware

func TokenRefresherMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func VerifyToken

func VerifyToken(tokenString string) (jwt.MapClaims, error)

VerifyToken verifies a token JWT validate

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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