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`, + ); } }