Update portal.go

This commit is contained in:
Lizandro Guarnizo
2026-05-16 14:12:39 -05:00
parent 76a0c28b16
commit edc0e7f791
+13 -2
View File
@@ -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)