From edc0e7f791f4f3db7954fa693b32af5231161678 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 16 May 2026 14:12:39 -0500 Subject: [PATCH] Update portal.go --- pkg/auth/portal.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/auth/portal.go b/pkg/auth/portal.go index 906d196..e51a6f6 100644 --- a/pkg/auth/portal.go +++ b/pkg/auth/portal.go @@ -17,8 +17,19 @@ func PortalUser(c *fiber.Ctx) (*models.PortalUser, error) { if raw == nil { return nil, errors.New("no portal session") } - id, ok := raw.(uint) - if !ok { + var id uint + switch v := raw.(type) { + case uint: + id = v + case uint64: + id = uint(v) + case uint32: + id = uint(v) + case int64: + id = uint(v) + case float64: + id = uint(v) + default: return nil, errors.New("invalid portal session") } u, err := models.GetPortalUserByID(id)