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)