mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
Fix no licence expiration date on self-hosted (#1217)
* Use our expiration date if no next billing date * Remove unnecessary null checks * Remove null check
This commit is contained in:
parent
aea85ea0eb
commit
694347e8d3
@ -26,7 +26,9 @@ namespace Bit.Core.Models.Business
|
||||
Premium = user.Premium;
|
||||
MaxStorageGb = user.MaxStorageGb;
|
||||
Issued = DateTime.UtcNow;
|
||||
Expires = subscriptionInfo?.UpcomingInvoice?.Date?.AddDays(7);
|
||||
Expires = subscriptionInfo?.UpcomingInvoice?.Date != null ?
|
||||
subscriptionInfo.UpcomingInvoice.Date.Value.AddDays(7) :
|
||||
user.PremiumExpirationDate?.AddDays(7);
|
||||
Refresh = subscriptionInfo?.UpcomingInvoice?.Date;
|
||||
Trial = (subscriptionInfo?.Subscription?.TrialEndDate.HasValue ?? false) &&
|
||||
subscriptionInfo.Subscription.TrialEndDate.Value > DateTime.UtcNow;
|
||||
|
Loading…
Reference in New Issue
Block a user