diff --git a/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-auth.controller.ts b/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-auth.controller.ts index b8c4333b8705..3d12f2a91238 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-auth.controller.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/controllers/microsoft-auth.controller.ts @@ -83,6 +83,7 @@ export class MicrosoftAuthController { const loginToken = await this.loginTokenService.generateLoginToken( user.email, + workspace.id, ); return res.redirect( diff --git a/packages/twenty-server/src/engine/core-modules/auth/token/services/login-token.service.ts b/packages/twenty-server/src/engine/core-modules/auth/token/services/login-token.service.ts index 054ecc3405d3..a1af3de1ae74 100644 --- a/packages/twenty-server/src/engine/core-modules/auth/token/services/login-token.service.ts +++ b/packages/twenty-server/src/engine/core-modules/auth/token/services/login-token.service.ts @@ -18,7 +18,10 @@ export class LoginTokenService { email: string, workspaceId: string, ): Promise { - const secret = this.jwtWrapperService.generateAppSecret('LOGIN'); + const secret = this.jwtWrapperService.generateAppSecret( + 'LOGIN', + workspaceId, + ); const expiresIn = this.environmentService.get('LOGIN_TOKEN_EXPIRES_IN');