This commit is contained in:
Lizandro Guarnizo
2026-05-15 15:47:49 -05:00
parent 04fd456a4c
commit f7e8d273d2
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -15,7 +15,9 @@ import (
// ─── Auth ─────────────────────────────────────────────────────────────────────
func PortalLoginPage(c *fiber.Ctx) error {
if auth.IsPortalLoggedIn(c) {
// Usar PortalUser (validación completa) en vez de IsPortalLoggedIn (solo key)
// para evitar loops cuando hay sesión obsoleta pero el usuario ya no existe en DB.
if user, err := auth.PortalUser(c); err == nil && user != nil {
return c.Redirect("/portal/dashboard")
}
return c.Render("portal/login", fiber.Map{