separate the auth routes from the user routes
This commit is contained in:
13
backend/routes/auth.go
Normal file
13
backend/routes/auth.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/controllers"
|
||||
"git.cromer.cl/Proyecto-Titulo/alai-server/backend/middlewares"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func AuthRoutes(router *httprouter.Router) {
|
||||
router.POST("/login", controllers.Login)
|
||||
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
|
||||
}
|
@@ -17,6 +17,7 @@ import (
|
||||
func Initialize() *httprouter.Router {
|
||||
router := httprouter.New()
|
||||
router.GET("/", index)
|
||||
AuthRoutes(router)
|
||||
FrameRoutes(router)
|
||||
GameRoutes(router)
|
||||
GodotVersionRoutes(router)
|
||||
|
@@ -8,9 +8,6 @@ import (
|
||||
)
|
||||
|
||||
func UserRoutes(router *httprouter.Router) {
|
||||
router.POST("/login", controllers.Login)
|
||||
router.GET("/auth", middlewares.Authenticate(controllers.AuthenticateUser))
|
||||
|
||||
router.GET("/user", middlewares.Authenticate(controllers.ListUser))
|
||||
router.GET("/user/:id", middlewares.Authenticate(controllers.GetUser))
|
||||
router.POST("/user", middlewares.Authenticate(controllers.CreateUser))
|
||||
|
Reference in New Issue
Block a user