auth

package
v0.0.0-...-c9ab0ac Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(requiredRole string) gin.HandlerFunc

func ExtractToken

func ExtractToken(c *gin.Context) string

func GenerateAdminToken

func GenerateAdminToken(user *models.User) (string, error)

func GenerateToken

func GenerateToken(user *models.User) (string, error)

func IsUserOrAdmin

func IsUserOrAdmin(c *gin.Context)

func VerifyToken

func VerifyToken(c *gin.Context) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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