feat: pagina principal configurable por rol (HomeUrl)

This commit is contained in:
Lizandro Guarnizo
2026-07-06 23:05:02 -05:00
parent 7d27240f27
commit 9a3a5d4b25
5 changed files with 50 additions and 5 deletions
+6 -2
View File
@@ -37,8 +37,12 @@ func LoginPost(c *fiber.Ctx) error {
return c.Redirect("/login?error=" + url.QueryEscape(err.Error()))
}
// Si todo está bien, redirige al inicio de la app
return c.Redirect("/app/servidor")
// Redirige según la página principal del rol, o por defecto a /app/servidor
homeUrl := "/app/servidor"
if user.Role.HomeUrl != "" {
homeUrl = user.Role.HomeUrl
}
return c.Redirect(homeUrl)
}
var store = session.New()