-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 회원 탈퇴(DELETE /users/me) 구현 #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
385fa7c
docs: 회원 탈퇴 기능 설계 spec과 구현 플랜 추가
parkjuyeong0312 b1f47d2
feat: V1.7 마이그레이션으로 users 회원 탈퇴 스키마 지원
parkjuyeong0312 a3e7804
feat: User에 soft delete와 익명화 도메인 메서드 추가
parkjuyeong0312 91be9f4
feat: WITHDRAWAL_REQUIRES_HOST_DELEGATION 에러 코드 추가
parkjuyeong0312 d441af1
feat: 회원 탈퇴용 RoomMember 조회 메서드 추가
parkjuyeong0312 dd6d0fc
feat: 회원 탈퇴 거절 응답 DTO와 예외 정의
parkjuyeong0312 7fee512
feat: RefreshTokenService에 사용자 단위 토큰 일괄 폐기 API 노출
parkjuyeong0312 3d92096
feat: 탈퇴 이벤트와 RTK 일괄 폐기 리스너 추가
parkjuyeong0312 c79a826
feat: UserWithdrawalService로 탈퇴 트랜잭션 오케스트레이션 구현
parkjuyeong0312 0e35f3c
feat: 회원 탈퇴 거절 응답 핸들러 추가
parkjuyeong0312 037afdb
feat: DELETE /users/me 탈퇴 엔드포인트와 만료 쿠키 처리
parkjuyeong0312 5a7349b
fix: 1인 방 탈퇴 삭제 순서 보강
parkjuyeong0312 edbc6bf
docs: 회원 탈퇴 정책을 features/erd/decisions에 반영
parkjuyeong0312 1eb1728
fix: 회원 탈퇴 차단 응답에 에러 정보 추가
parkjuyeong0312 3de05dd
fix: 탈퇴 유저 토큰 재발급 차단
parkjuyeong0312 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # users soft delete: partial unique index + CHECK 채택 | ||
|
|
||
| - **상태**: 결정 | ||
| - **날짜**: 2026-06-07 | ||
| - **관련**: docs/superpowers/specs/2026-06-07-user-withdrawal-design.md | ||
|
|
||
| ## 배경 | ||
|
|
||
| 이용약관/개인정보 정책상 회원 탈퇴 기능이 필요하다. 채팅 등 공동 협업 데이터의 무결성을 유지하면서 탈퇴자의 개인정보는 즉시 제거되어야 한다. 동시에 `users.email`과 `(provider, provider_id)`에 걸린 UNIQUE 제약 때문에 단순히 컬럼을 NULL로 비울 수 없다. | ||
|
|
||
| ## 결정 | ||
|
|
||
| `users`를 soft delete 모델로 운영한다. | ||
|
|
||
| - 활성 회원: `email`, `nickname`, `provider`, `provider_id`는 NOT NULL. | ||
| - 탈퇴 회원: 위 컬럼들 NULL 허용. `deleted_at`이 NOT NULL. | ||
| - 활성 회원에 한해 unique 강제: PostgreSQL partial unique index (`WHERE deleted_at IS NULL`). | ||
| - 조건부 NOT NULL은 CHECK `users_active_required`로 보장. | ||
| - 엔티티에 `@SQLRestriction("deleted_at IS NULL")`을 적용해 JPA 조회에서 탈퇴자를 자동 제외. | ||
|
|
||
| ## 대안 검토 | ||
|
|
||
| - **placeholder 값**(`deleted+{id}@deleted.local` 등): NOT NULL/UNIQUE 제약을 그대로 둘 수 있으나 통계/검색에 가짜 값이 섞이고, 재가입 시 충돌 회피가 복잡하다. 동일 계정 재가입 차단이 정책 요건이 아닌 본 프로젝트에서는 이점이 없다. | ||
| - **분리된 `deleted_users` 테이블**: row 이관 비용과 추가 join이 필요하다. soft delete의 단순성을 잃는다. | ||
|
|
||
| ## 영향 | ||
|
|
||
| - DDL 변경(`V1.7__users_withdrawal.sql`): NOT NULL drop, 기존 UNIQUE 제약 제거, partial unique index 및 CHECK 추가. | ||
| - `User` 엔티티에 `deletedAt`, `anonymize()`, `isWithdrawn()` 추가. | ||
| - 동일 OAuth 계정 재가입 가능. 정책상 차단할 필요가 있을 때만 별도 결정 기록으로 변경한다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.