Documentation
¶
Index ¶
Constants ¶
View Source
const (
SessionUserID = "user_id"
)
Variables ¶
This section is empty.
Functions ¶
func CSRFMiddleware ¶ added in v0.2.0
func CSRFMiddleware() gin.HandlerFunc
CSRFMiddleware provides CSRF protection for state-changing operations
func GetCSRFToken ¶ added in v0.2.0
GetCSRFToken retrieves the CSRF token from the context
func RequireAdmin ¶ added in v0.2.0
func RequireAdmin(userService *services.UserService) gin.HandlerFunc
RequireAdmin is a middleware that requires the user to have admin role This middleware should be used after RequireAuth
func RequireAuth ¶
func RequireAuth() gin.HandlerFunc
RequireAuth is a middleware that requires the user to be logged in
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.