middleware

package
v0.0.0-...-21c6822 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminMiddleware

func AdminMiddleware() gin.HandlerFunc

AdminMiddleware checks if the authenticated user has admin role. This middleware should be used after AuthMiddleware.

func AuthMiddleware

func AuthMiddleware() gin.HandlerFunc

AuthMiddleware validates JWT tokens and sets user information in the context. It expects the Authorization header with format: "Bearer <token>". On success, it sets user_id, username, and role in the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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