1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 23:52:50 -05:00

Stopped subtracting grace period from expiration date when license is in trial (#3991)

This commit is contained in:
Alex Morask
2024-04-30 10:55:05 -04:00
committed by GitHub
parent cb55699d80
commit ccaee0b719

View File

@ -142,12 +142,13 @@ public class OrganizationSubscriptionResponseModel : OrganizationResponseModel
{
if (license != null)
{
// License expiration should always include grace period - See OrganizationLicense.cs
// License expiration should always include grace period (unless it's in a Trial) - See OrganizationLicense.cs.
Expiration = license.Expires;
// Use license.ExpirationWithoutGracePeriod if available, otherwise assume license expiration minus grace period
ExpirationWithoutGracePeriod = license.ExpirationWithoutGracePeriod ??
license.Expires?.AddDays(-Constants
.OrganizationSelfHostSubscriptionGracePeriodDays);
// Use license.ExpirationWithoutGracePeriod if available, otherwise assume license expiration minus grace period unless it's in a Trial.
ExpirationWithoutGracePeriod = license.ExpirationWithoutGracePeriod ?? (license.Trial
? license.Expires
: license.Expires?.AddDays(-Constants.OrganizationSelfHostSubscriptionGracePeriodDays));
}
}