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.
Click to show internal directories.
Click to hide internal directories.