Skip to content

Comments

[fix/socket-http] - 백엔드 httpOnly 설정 변경#39

Merged
ramong26 merged 1 commit intodevelopfrom
fix/socket-http
Feb 7, 2026
Merged

[fix/socket-http] - 백엔드 httpOnly 설정 변경#39
ramong26 merged 1 commit intodevelopfrom
fix/socket-http

Conversation

@ramong26
Copy link
Collaborator

@ramong26 ramong26 commented Feb 7, 2026

Summary by CodeRabbit

릴리스 노트

  • 버그 수정

    • 인증 토큰 쿠키 보안 플래그 개선
    • 토큰 생성 및 저장 로직 최적화
    • 인증 응답 형식 표준화
  • 새로운 기능

    • 채팅 연결에 폴링 전송 방식 추가 지원

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

개요

인증 서비스의 쿠키 보안 설정 및 토큰 관리 로직을 개선하고, 채팅 게이트웨이의 WebSocket 전송 방식을 확장했습니다. 토큰 생성 로직을 중앙화하고 인증 응답에 refreshToken을 포함시켰으며, 채팅 게이트웨이에서는 폴링 전송을 추가하고 토큰 추출 로직을 단순화했습니다.

변경사항

응집도 / 파일(들) 요약
인증 서비스 토큰 및 쿠키 관리
src/auth/service/auth.service.ts
쿠키 보안 플래그 개선(httpOnly, secure, sameSite 조정), generateTokens() 헬퍼 메서드 추가, 토큰 지속성을 accessExpiresAt/refreshExpiresAt로 업데이트, 인증 응답에 refreshToken 포함, 프로필 이미지 기본값을 null로 설정
채팅 게이트웨이 전송 및 토큰 처리
src/chat/gateways/chat.gateway.ts
WebSocketGateway 설정 확장(websocket, polling 전송 지원), CORS에 Set-Cookie 헤더 노출, 토큰 추출 로직 단순화(handshake.auth.token 우선), 쿠키 기반 디코딩 경로 제거

코드 리뷰 예상 난이도

🎯 3 (보통) | ⏱️ ~20분

🐰 토큰의 춤, 쿠키의 노래~
refreshToken이 춤을 추며 나타나고,
폴링도 손을 잡아 파티에 합류했네요!
보안을 지키며 가볍게,
인증의 흐름이 더욱 우아해졌어요! ✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@Parkchanyoung0710 Parkchanyoung0710 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ramong26 ramong26 merged commit 5a1e7ed into develop Feb 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants