Skip to content

The open alternative to Salesforce, designed for AI.

block invite link if workspace subscription is not active (#4991)

Weiko6211f84de886
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
index 51f75284881..c783cef338d 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
@@ -132,11 +132,12 @@ export class SignInUpService {
}) {
const workspace = await this.workspaceRepository.findOneBy({
inviteHash: workspaceInviteHash,
+ subscriptionStatus: 'active',
});
assert(
workspace,
- 'This workspace inviteHash is invalid',
+ 'This workspace inviteHash is invalid or the workspace is not active',
ForbiddenException,
);