mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-19 18:32:29 +00:00
0f4c831fab
isHostedSubscriptionValid was treating any tenant with a non-nil TrialEndsAt as a valid bounded trial, never comparing the timestamp to the current time. A tenant whose trial ended in the past but whose stored subscription state was still "trial" (e.g. lease refresh failed or never ran) retained full hosted Cloud access indefinitely. The validity rule now requires both that a trial end timestamp exists AND that time.Now() is before it. Refactored the switch to make the trial branch read explicitly: nil evaluator -> deny, nil end -> deny, past end -> deny, otherwise allow. Added TestTenantMiddleware_HostedMode_ExpiredTrial_Blocked as the regression test (mirrors the existing BoundedTrial_Allowed + UnboundedTrial_Blocked pair with a past-dated trial end).