Skip to content

Commit

Permalink
refactor/#55/메인페이지 리다이렉트 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
gwgw123 committed Jan 2, 2025
1 parent d21ef93 commit e3393e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -38,6 +40,9 @@ export class AuthController {
await this.authService.googleLogin(user);

await this.cookieService.cookieResponse(res, accessToken, refreshToken);

// 메인페이지로 리다이렉트
res.redirect(this.configService.get<string>('CLIENT_MAIN_PAGE_URL'));
}

// 로그아웃
Expand Down
3 changes: 0 additions & 3 deletions src/auth/services/cookie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ export class CookieService {

// refreshToken 쿠키 설정
await this.setRefreshTokenCookie(res, refreshToken);

// 메인페이지로 리다이렉트
res.redirect(this.configService.get<string>('CLIENT_MAIN_PAGE_URL'));
}

// 쿠키 삭제 (로그아웃시)
Expand Down

0 comments on commit e3393e0

Please sign in to comment.