Skip to content

Conversation

@lilloo04
Copy link
Member

@lilloo04 lilloo04 commented May 6, 2025

1. 무슨 이유로 코드를 변경했나요?

  • Refresh Token 재발급 안정화
    • 기존에는 로그인할 때마다 refresh_token이 중복 저장되어, 이전 토큰으로는 /auth/refresh 실패 발생
    • 사용자당 하나의 refresh_token만 유지되도록 deleteByUserId()를 통해 중복 제거 처리
    • 로그인 / 토큰 재발급 시 기존 토큰을 먼저 삭제 후 새로운 토큰 저장
  • User 정보 관리 기능 추가
    • 사용자 정보 조회, 수정, 삭제(soft delete) API 구현
    • 로그인한 사용자의 토큰(Authorization: Bearer) 기반으로 자기 정보만 수정/삭제 가능
    • UserProfileService, UserProfileController로 역할 분리 및 의존성 최소화

2. 어떤 위험이나 장애를 발견했나요?

  • refresh_token이 계속 insert되면서 DB에 중복 토큰이 누적됨 → 잘못된 토큰으로 요청 시 500 에러
  • 수정/삭제 시 토큰 검증 없이 userId를 직접 전달받게 되면 보안 이슈 발생 가능
  • 유저 정보 GET /user 호출 시 비활성 유저도 조회되는 문제 가능성 → is_active 체크 로직 추가함

3. 관련 스크린샷을 첨부해주세요.

  • Refresh Token 재발급
image1 - User 조회 image2 - User 수정 image3 - User 삭제 image4

closed #70

@lilloo04 lilloo04 requested review from rootTiket and soyesenna May 6, 2025 13:21
@lilloo04 lilloo04 self-assigned this May 6, 2025
@lilloo04 lilloo04 linked an issue May 7, 2025 that may be closed by this pull request
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.

[5주차] 박시현 / [feat] 미구현 API 구현

1 participant