diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 9e87393..8bec7de 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -14,10 +14,12 @@ import { CookieService } from './services/cookie.service'; import { TokenService } from './services/token.service'; import { RedisService } from './redis/redis.service'; import { UsersService } from 'src/users/services/users.service'; +import { ConfigService } from '@nestjs/config'; @Controller('auth') export class AuthController { constructor( + private readonly configService: ConfigService, private readonly authService: AuthService, private readonly cookieService: CookieService, private readonly tokenService: TokenService, @@ -38,6 +40,9 @@ export class AuthController { await this.authService.googleLogin(user); await this.cookieService.cookieResponse(res, accessToken, refreshToken); + + // 메인페이지로 리다이렉트 + res.redirect(this.configService.get('CLIENT_MAIN_PAGE_URL')); } // 로그아웃 diff --git a/src/auth/services/cookie.service.ts b/src/auth/services/cookie.service.ts index c0ed167..23ddf8a 100644 --- a/src/auth/services/cookie.service.ts +++ b/src/auth/services/cookie.service.ts @@ -49,9 +49,6 @@ export class CookieService { // refreshToken 쿠키 설정 await this.setRefreshTokenCookie(res, refreshToken); - - // 메인페이지로 리다이렉트 - res.redirect(this.configService.get('CLIENT_MAIN_PAGE_URL')); } // 쿠키 삭제 (로그아웃시)