This commit is contained in:
2026-03-20 12:33:37 +01:00
commit ce3925423f
44 changed files with 3143 additions and 0 deletions

23
internal/auth/routes.go Normal file
View File

@@ -0,0 +1,23 @@
package auth
import (
"ResendIt/internal/api/middleware"
"github.com/gin-gonic/gin"
)
func RegisterRoutes(r *gin.RouterGroup, h *Handler) {
auth := r.Group("/auth")
auth.POST("/login", h.Login)
protected := auth.Group("/")
protected.Use(middleware.AuthMiddleware())
protected.GET("/me", h.Me)
admin := protected.Group("/")
admin.Use(middleware.RequireRole("admin"))
admin.GET("/admin-check", h.AdminCheck)
}