auth

package
v0.0.0-...-bf3b954 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IsAdminContextKey = "admin"
	UserIDContextKey  = "user"
)
View Source
var JWT_KEY = []byte("super_secret")

Functions

func GenerateToken

func GenerateToken(userID string) string

func LoadToken

func LoadToken(db *sqlx.DB) func(next echo.HandlerFunc) echo.HandlerFunc

HTTP middleware setting a value on the request context

func ParseToken

func ParseToken(token string) (string, error)

func RequireAdmin

func RequireAdmin(next echo.HandlerFunc) echo.HandlerFunc

func RequireAuthMiddleWare

func RequireAuthMiddleWare(next echo.HandlerFunc) echo.HandlerFunc

func RequireNoAuthMiddleWare

func RequireNoAuthMiddleWare(next echo.HandlerFunc) echo.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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