Update portal.go

This commit is contained in:
Lizandro Guarnizo
2026-05-15 16:30:41 -05:00
parent 41fe416986
commit dd567a156b
+9 -2
View File
@@ -19,8 +19,15 @@ 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 int64:
id = uint(v)
case float64:
id = uint(v)
default:
log.Printf("[PORTAL SESSION] type assertion failed: %T", raw)
return nil, errors.New("invalid portal session")
}