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
+5 -1
View File
@@ -11,7 +11,11 @@ import (
func RedirectToHomePageOnLogin(c *fiber.Ctx) error {
if auth.IsLoggedIn(c) {
return c.Redirect("/app/dashboard")
user, err := auth.User(c)
if err == nil && user != nil && user.Role.HomeUrl != "" {
return c.Redirect(user.Role.HomeUrl)
}
return c.Redirect("/app/servidor")
}
// Si tiene sesión de portal activa, ir al portal
if user, err := auth.PortalUser(c); err == nil && user != nil {