Skip to content

[Feat/#229] 통합 회원탈퇴 API 추가 - #230

Merged
sungtaegyeong merged 5 commits into
developfrom
feat/#229
Aug 2, 2026
Merged

[Feat/#229] 통합 회원탈퇴 API 추가#230
sungtaegyeong merged 5 commits into
developfrom
feat/#229

Conversation

@sungtaegyeong

Copy link
Copy Markdown
Member

📌 관련 이슈번호

(Closes 키워드가 있어야 PR이 머지되었을 때 이슈가 자동으로 닫힌다)

📌 PR 유형

어떤 변경 사항이 있나요?

  • 새 기능 추가
  • 버그 수정
  • 리팩토링

📌 PR 요약

로그인한 사용자가 앱 내에서 회원탈퇴를 진행할 수 있도록 통합 회원탈퇴 API를 추가했습니다.

📌 작업 세부 내용

  1. DELETE /api/v1/auth/withdraw 회원탈퇴 API를 추가했습니다.
  2. 회원탈퇴 시 현재 로그인한 사용자를 soft delete 처리하도록 구현했습니다.
  3. 회원탈퇴 시 해당 사용자의 Refresh Token을 전체 무효화하도록 구현했습니다.
  4. 탈퇴한 사용자의 기존 Access Token으로 보호 API에 접근할 수 없도록 인증 로직에서 활성 유저 여부를 검증하도록 보완했습니다.
  5. Swagger에 통합 회원탈퇴 API 명세를 추가했습니다.

📸 스크린샷 (선택)

🔗 참고 자료

@sungtaegyeong sungtaegyeong self-assigned this Aug 2, 2026
@sungtaegyeong sungtaegyeong linked an issue Aug 2, 2026 that may be closed by this pull request
4 tasks
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@sungtaegyeong, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 47b0361e-4742-4000-8075-065923e4dc15

📥 Commits

Reviewing files that changed from the base of the PR and between fa30b34 and 4ec94dc.

📒 Files selected for processing (2)
  • src/auth/auth.service.ts
  • src/users/user.service.ts

Walkthrough

회원 탈퇴 API를 추가했습니다. 인증된 사용자의 활성 상태를 검증하고, 트랜잭션에서 Refresh Token을 폐기한 뒤 사용자를 soft delete합니다. Swagger 문서와 탈퇴 사용자에 대한 JWT 인증 검증도 추가했습니다.

Changes

회원 탈퇴 기능

Layer / File(s) Summary
활성 사용자 인증 검증
src/auth/jwt.strategy.ts, src/users/user.service.ts
JwtStrategyUserService로 활성 사용자를 조회합니다. 탈퇴한 사용자는 인증 실패 처리합니다.
회원 탈퇴 트랜잭션
src/auth/auth.service.ts, src/users/user.service.ts
AuthService.withdraw가 Refresh Token 전체를 폐기하고 사용자를 soft delete합니다.
회원 탈퇴 엔드포인트와 문서
src/auth/auth.controller.ts, src/auth/auth.swagger.ts
인증된 사용자 ID를 DELETE /auth/withdraw에서 받아 탈퇴 서비스를 호출합니다. Swagger에 성공 및 오류 응답을 정의합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • TEAM-DAILOG/BE#49: JWT 인증과 @CurrentUserId() 기반 인증 엔드포인트를 확장하는 흐름과 관련됩니다.
  • TEAM-DAILOG/BE#33: AuthService, AuthController, JWT 및 Refresh Token 처리 변경과 관련됩니다.
  • TEAM-DAILOG/BE#172: 인증 서비스에서 Refresh Token 폐기를 처리하는 흐름과 관련됩니다.

Suggested reviewers: yangwooyoung123

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 통합 회원탈퇴 API 추가라는 주요 변경 사항을 명확하게 요약합니다.
Description check ✅ Passed 설명이 회원탈퇴 API, soft delete, 토큰 무효화, 인증 차단, Swagger 변경을 구체적으로 설명합니다.
Linked Issues check ✅ Passed #229의 API 추가, Refresh Token 무효화, Access Token 인증 차단, Swagger 문서 요구사항을 모두 반영합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 회원탈퇴 처리와 탈퇴 사용자 인증 차단이라는 #229의 범위에 포함됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#229

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/auth/auth.controller.ts (1)

116-123: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

컨트롤러 메서드명을 동사와 명사로 구성하세요.

withdraw는 동사만 사용합니다. 외부 라우트는 유지하고 메서드명을 withdrawUser로 변경하세요.

As per path instructions, "메서드명은 동사 + 명사 형태로 작성했는지".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/auth/auth.controller.ts` around lines 116 - 123, Rename the
AuthController method withdraw to withdrawUser so it follows the verb-plus-noun
naming convention, while keeping the existing DELETE withdraw route, decorators,
and authService.withdraw(userId) call unchanged.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/auth/auth.service.ts`:
- Around line 394-410: Update withdraw and the refresh-token issuance service
flow so active-user validation and token creation use the same transaction and
row-locking policy as revokeAllRefreshTokens and softDeleteUser. Ensure
withdrawal locks or otherwise serializes the user record before validation, and
make refresh-token issuance recheck the locked active state within its
transaction so requests during or after withdrawal cannot persist a token.

In `@src/auth/auth.swagger.ts`:
- Line 399: Update the 500 ApiResponse declaration in the auth Swagger
configuration to include the project failure-response schema/example with
resultType "FAIL", code 500, errorCode "INTERNAL_SERVER_ERROR", the specified
Korean reason, and data null, while retaining the existing description.

---

Nitpick comments:
In `@src/auth/auth.controller.ts`:
- Around line 116-123: Rename the AuthController method withdraw to withdrawUser
so it follows the verb-plus-noun naming convention, while keeping the existing
DELETE withdraw route, decorators, and authService.withdraw(userId) call
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 92f7a597-0a8f-4e93-a6e9-fb7272064257

📥 Commits

Reviewing files that changed from the base of the PR and between 6a5c98c and fa30b34.

📒 Files selected for processing (5)
  • src/auth/auth.controller.ts
  • src/auth/auth.service.ts
  • src/auth/auth.swagger.ts
  • src/auth/jwt.strategy.ts
  • src/users/user.service.ts

Comment thread src/auth/auth.service.ts
Comment thread src/auth/auth.swagger.ts
},
},
}),
ApiResponse({ status: 500, description: '서버 내부 오류' }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

500 실패 응답 스키마를 명시하세요.

현재 500 응답은 설명만 제공합니다. resultType, code, errorCode, reason, data를 포함하는 프로젝트 실패 응답 예시를 추가하세요. 클라이언트가 오류 응답 형식을 Swagger에서 확인할 수 있어야 합니다.

As per coding guidelines, Use custom failure responses that follow the project format: { "resultType": "FAIL", "code": 500, "errorCode": "INTERNAL_SERVER_ERROR", "reason": "서버 내부 오류가 발생했습니다", "data": null }.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/auth/auth.swagger.ts` at line 399, Update the 500 ApiResponse declaration
in the auth Swagger configuration to include the project failure-response
schema/example with resultType "FAIL", code 500, errorCode
"INTERNAL_SERVER_ERROR", the specified Korean reason, and data null, while
retaining the existing description.

Source: Coding guidelines

@sungtaegyeong
sungtaegyeong merged commit 1551702 into develop Aug 2, 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.

[Feat] 통합 회원탈퇴 API 추가

1 participant