This commit is contained in:
fabio
2026-02-22 17:51:25 +01:00
parent 036aadb09a
commit c60ff109a4
11 changed files with 444 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ func RegisterRoutes(app *fiber.App, store *session.Store, database *gorm.DB, cfg
return fmt.Errorf("init auth service: %w", err)
}
authController := controllers.NewAuthController(authService)
usersController := controllers.NewUsersController(services.NewUsersService(database))
app.Get("/healthz", func(c *fiber.Ctx) error {
return c.SendStatus(fiber.StatusOK)
@@ -39,10 +40,13 @@ func RegisterRoutes(app *fiber.App, store *session.Store, database *gorm.DB, cfg
app.Post("/forgot-password", authController.ForgotPassword)
app.Get("/reset-password", authController.ShowResetPassword)
app.Post("/reset-password", authController.ResetPassword)
app.Get("/users", httpmw.RequireAuth(), usersController.Index)
app.Get("/users/table", httpmw.RequireAuth(), usersController.Table)
app.Get("/users/:id/modal", httpmw.RequireAuth(), usersController.Modal)
private := app.Group("/private", httpmw.RequireAuth())
private.Get("/", func(c *fiber.Ctx) error {
return c.SendString("private area")
return c.Redirect("/users")
})
admin := app.Group("/admin", httpmw.RequireAuth(), httpmw.RequireAdmin())