genarato alcuni partials e corretto drop down

This commit is contained in:
fabio
2026-02-23 17:09:35 +01:00
parent 3fc01cc4f7
commit 2552b8ad8f
35 changed files with 587 additions and 221 deletions

View File

@@ -25,7 +25,7 @@ func RequireAdmin() fiber.Handler {
return c.Redirect("/login")
}
if user.Role != models.RoleAdmin {
return c.Status(fiber.StatusForbidden).SendString("forbidden")
return c.Status(fiber.StatusForbidden).Redirect("/forbidden")
}
return c.Next()
}

View File

@@ -48,6 +48,7 @@ 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("/forbidden", authController.ShowForbidden)
app.Get("/welcome", httpmw.RequireAuth(), authController.ShowWelcome)
private := app.Group("/private", httpmw.RequireAuth(), httpmw.RequireAdmin())