auth

package
v0.0.0-...-22b9301 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SecretKey = "my_secret"

TODO: Move Secret to ENV https://github.com/hay-i/gooal/issues/35

Functions

func GetTokenFromCookie

func GetTokenFromCookie(c echo.Context) (string, error)

func HandleInvalidToken

func HandleInvalidToken(c echo.Context, message string) error

func IsLoggedIn

func IsLoggedIn(c echo.Context) bool

func ParseToken

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

func SetCookie

func SetCookie(signedToken string, expiry time.Time, c echo.Context)

func SignToken

func SignToken(user models.User) (time.Time, string, error)

func TokenToUsername

func TokenToUsername(token jwt.MapClaims) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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