backend: remove register and admin user management routes

- Remove /api/auth/register endpoint
- Remove /api/admin/users CRUD routes
- Simplify router to only keep auth/login and health endpoints
This commit is contained in:
2026-04-16 16:55:02 +00:00
parent b0b85f4d3a
commit 300039b14e

View File

@@ -22,30 +22,13 @@ func Setup(cfg *config.Config) *gin.Engine {
authHandler := handler.NewAuthHandler(userService)
healthHandler := handler.NewHealthHandler(db.DB)
adminHandler := handler.NewAdminHandler(userService)
// Public routes
r.POST("/api/auth/register", authHandler.Register)
r.POST("/api/auth/local-login", authHandler.LocalLogin)
r.POST("/api/auth/lookup-binding", authHandler.LookupBinding)
r.POST("/api/auth/bind-keycloak", authHandler.BindKeycloak)
r.POST("/api/auth/init", authHandler.InitAdmin)
r.GET("/api/health", healthHandler.Check)
// Protected routes
api := r.Group("/api")
api.Use(middleware.AuthProxy())
{
}
// Admin routes
admin := api.Group("/admin")
admin.Use(middleware.RequireRole("admin"))
{
admin.GET("/users", adminHandler.ListUsers)
admin.POST("/users", adminHandler.CreateUser)
admin.DELETE("/users/:id", adminHandler.DeleteUser)
}
return r
}