Skip to content

The open alternative to Salesforce, designed for AI.

BUG FIX: Create workspace member if inviteHash exists (#3917)

martmulld016e5ff0355
diff --git a/packages/twenty-server/src/core/auth/services/auth.service.ts b/packages/twenty-server/src/core/auth/services/auth.service.ts
index 946bb698569..2b481a83691 100644
--- a/packages/twenty-server/src/core/auth/services/auth.service.ts
+++ b/packages/twenty-server/src/core/auth/services/auth.service.ts
@@ -167,7 +167,13 @@ export class AuthService {
defaultWorkspace: workspace,
});
- return await this.userRepository.save(userToCreate);
+ const user = await this.userRepository.save(userToCreate);
+
+ if (workspaceInviteHash) {
+ await this.userService.createWorkspaceMember(user);
+ }
+
+ return user;
}
async verify(email: string): Promise<Verify> {