Skip to content

Commit

Permalink
set allowed as false if subscription has expired
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiolms committed Sep 6, 2024
1 parent 1f24a33 commit d640245
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/git/gitProviderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { Container } from '../container';
import { AccessDeniedError, CancellationError, ProviderNotFoundError } from '../errors';
import type { FeatureAccess, Features, PlusFeatures, RepoFeatureAccess } from '../features';
import type { Subscription } from '../plus/gk/account/subscription';
import { isSubscriptionPaidPlan, SubscriptionPlanId } from '../plus/gk/account/subscription';
import { isSubscriptionExpired, isSubscriptionPaidPlan, SubscriptionPlanId } from '../plus/gk/account/subscription';
import type { SubscriptionChangeEvent } from '../plus/gk/account/subscriptionService';
import type { HostingIntegration } from '../plus/integrations/integration';
import type { RepoComparisonKey } from '../repositories';
Expand Down Expand Up @@ -739,7 +739,10 @@ export class GitProviderService implements Disposable {

const plan = subscription.plan.effective.id;
if (isSubscriptionPaidPlan(plan)) {
return { allowed: subscription.account?.verified !== false, subscription: { current: subscription } };
return {
allowed: subscription.account?.verified !== false && !isSubscriptionExpired(subscription),
subscription: { current: subscription },
};
}

function getRepoAccess(
Expand Down

0 comments on commit d640245

Please sign in to comment.