1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-26 22:31:30 +01:00

custom plans with expiration are not trials

This commit is contained in:
Kyle Spearrin 2017-12-04 20:58:23 -05:00
parent 88c35f9f86
commit 8c32765f4c

View File

@ -41,8 +41,16 @@ namespace Bit.Core.Models.Business
if(billingInfo?.Subscription == null)
{
Expires = Refresh = Issued.AddDays(7);
Trial = true;
if(org.PlanType == PlanType.Custom && org.ExpirationDate.HasValue)
{
Expires = Refresh = org.ExpirationDate.Value;
Trial = false;
}
else
{
Expires = Refresh = Issued.AddDays(7);
Trial = true;
}
}
else if(billingInfo.Subscription.TrialEndDate.HasValue &&
billingInfo.Subscription.TrialEndDate.Value > DateTime.UtcNow)