[feature/backend] implement /users auth middleware
This commit is contained in:
parent
a853374009
commit
823bedd1fa
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"tss-rocks-be/internal/config"
|
"tss-rocks-be/internal/config"
|
||||||
|
"tss-rocks-be/internal/middleware"
|
||||||
"tss-rocks-be/internal/service"
|
"tss-rocks-be/internal/service"
|
||||||
"tss-rocks-be/internal/types"
|
"tss-rocks-be/internal/types"
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ func (h *Handler) RegisterRoutes(r *gin.Engine) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// User routes
|
// User routes
|
||||||
users := api.Group("/users")
|
users := api.Group("/users", middleware.AuthMiddleware(h.config.JWT.Secret))
|
||||||
{
|
{
|
||||||
users.GET("", h.ListUsers)
|
users.GET("", h.ListUsers)
|
||||||
users.POST("", h.CreateUser)
|
users.POST("", h.CreateUser)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue