This commit is contained in:
Lizandro Guarnizo
2026-05-16 15:26:48 -05:00
parent f5eef70e09
commit 1b22cc2fe7
9 changed files with 118 additions and 21 deletions
+4
View File
@@ -44,9 +44,13 @@ func PortalUser(c *fiber.Ctx) (*models.PortalUser, error) {
}
// SetPortalSession guarda el portal_user_id en la sesión.
// Regenera el ID de sesión para prevenir session fixation.
func SetPortalSession(c *fiber.Ctx, userID uint) error {
store := app.Http.Session.Get(c)
store.Set(portalSessionKey, userID)
if err := store.Regenerate(); err != nil {
return err
}
return store.Save()
}