genarato alcuni partials e corretto drop down
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user