From 9053769616f4f3c8f89424d6d431271e751d82c9 Mon Sep 17 00:00:00 2001 From: Weiko Date: Fri, 26 Jan 2024 18:28:06 +0100 Subject: [PATCH] [Messaging] Fix gmail connected account creation redirect url (#3653) --- .../core/auth/controllers/google-gmail-auth.controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-server/src/core/auth/controllers/google-gmail-auth.controller.ts b/packages/twenty-server/src/core/auth/controllers/google-gmail-auth.controller.ts index 9a2bb1e4f..5d489ed78 100644 --- a/packages/twenty-server/src/core/auth/controllers/google-gmail-auth.controller.ts +++ b/packages/twenty-server/src/core/auth/controllers/google-gmail-auth.controller.ts @@ -7,12 +7,14 @@ import { GoogleGmailOauthGuard } from 'src/core/auth/guards/google-gmail-oauth.g import { GoogleGmailRequest } from 'src/core/auth/strategies/google-gmail.auth.strategy'; import { GoogleGmailService } from 'src/core/auth/services/google-gmail.service'; import { TokenService } from 'src/core/auth/services/token.service'; +import { EnvironmentService } from 'src/integrations/environment/environment.service'; @Controller('auth/google-gmail') export class GoogleGmailAuthController { constructor( private readonly googleGmailService: GoogleGmailService, private readonly tokenService: TokenService, + private readonly environmentService: EnvironmentService, ) {} @Get() @@ -44,6 +46,8 @@ export class GoogleGmailAuthController { refreshToken, }); - return res.redirect('http://localhost:3001/settings/accounts'); + return res.redirect( + `${this.environmentService.getFrontBaseUrl()}/settings/accounts`, + ); } }