Skip to content

Comments

보안 페이지#94

Merged
topeanut merged 1 commit intodevelopfrom
feature/personal-info-page
Jan 26, 2026
Merged

보안 페이지#94
topeanut merged 1 commit intodevelopfrom
feature/personal-info-page

Conversation

@topeanut
Copy link
Collaborator

@topeanut topeanut commented Jan 22, 2026

📝 요약

  • 한 줄 요약

✅ 작업 내용

  • 이런 일을
  • 했습니다

🧪 테스트 방법

  • ex) console.log
  • ex2) .env

📷 참고 자료 (스크린샷/링크/GIF 등)

🔬 관련 이슈

  • close #ISSUE_NUMBER

☝️ 참고 사항

  • 참고하세요~

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 계정 삭제 기능이 추가되었습니다. 사용자는 설정에서 계정 삭제 페이지로 이동할 수 있으며, 삭제 전 동의 절차를 거친 후 계정을 영구 삭제할 수 있습니다. 페이지에는 데이터 삭제 정책 설명과 단계별 안내가 포함되어 있습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link
Contributor

vercel bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
valanse-origin-repo Ready Ready Preview Jan 22, 2026 11:48am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

계정 삭제 기능을 구현하는 새로운 페이지를 추가합니다. 사용자 동의 체크박스로 삭제 의도를 확인하고, 삭제 요청을 dispatch한 후 성공 시 메인 페이지로 리디렉션합니다. 계정 제어 섹션에서 계정 삭제 페이지로의 네비게이션을 추가합니다.

Changes

Cohort / File(s) 변경 사항
계정 삭제 페이지 컴포넌트
src/components/pages/account-deletion/accountDeletionPage.tsx
사용자 동의 확인 체크박스, 삭제 불가역성 경고, signoutThunk dispatch, 로딩 상태 처리, 성공 시 엔트리 페이지로 리디렉션 로직을 포함하는 새로운 클라이언트 컴포넌트 추가
계정 삭제 라우트
src/app/account-deletion/page.tsx
AccountDeletionPage 컴포넌트를 렌더링하는 새로운 Next.js 앱 라우터 페이지 추가
계정 제어 섹션
src/components/pages/my/accountControlSection.tsx
signoutThunk import 제거, useRouter 추가, handleSignout을 /account-deletion으로 네비게이션하는 router.push로 변경

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant AccountDeletionPage as AccountDeletion<br/>Page
    participant Redux as Redux Store<br/>(signoutThunk)
    participant Backend as Backend API
    participant Router as Next Router

    User->>AccountDeletionPage: 페이지 접속
    User->>AccountDeletionPage: 동의 체크박스 선택
    User->>AccountDeletionPage: 계정 삭제 버튼 클릭
    AccountDeletionPage->>AccountDeletionPage: 로딩 상태 설정
    AccountDeletionPage->>Redux: signoutThunk dispatch
    Redux->>Backend: 계정 삭제 요청
    alt 삭제 성공
        Backend-->>Redux: 성공 응답
        Redux-->>AccountDeletionPage: 상태 업데이트
        AccountDeletionPage->>Router: /entry로 리디렉션
    else 삭제 실패
        Backend-->>Redux: 오류 응답
        Redux-->>AccountDeletionPage: 오류 상태 업데이트
        AccountDeletionPage->>User: 오류 알림 표시
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • [Feature] #38/mypage #42: src/components/pages/my/accountControlSection.tsx의 계정 제어 컴포넌트 signout/로그아웃 동작을 수정하므로 관련성 있음

Poem

🐰 새로운 길을 만들었네요,
계정 삭제의 여정을 밝혀주고,
동의 확인과 로딩 상태,
리디렉션까지 우아하게 처리하니
사용자의 선택을 존중하는 마음이 담겼군요! 🌟

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning PR 제목이 '보안 페이지'(Security Page)인데, 실제 변경사항은 '계정 삭제' 기능을 구현한 것입니다. 제목이 변경사항의 핵심 내용과 맞지 않습니다. PR 제목을 '계정 삭제 페이지 추가' 또는 'Add account deletion page'로 변경하여 실제 변경사항을 정확히 반영해주세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/pages/account-deletion/accountDeletionPage.tsx`:
- Around line 27-31: The handler currently dispatches signoutThunk (which
actually calls /auth/withdraw) and sets isDeleting only on entry; rename
signoutThunk to a clearer name like deleteAccountThunk (or add a clear comment
above signoutThunk) and update its import/usages in this component, and wrap the
dispatch in a try/catch/finally around setIsDeleting so errors are handled (log
and show an alert in catch) and setIsDeleting(false) is always executed in
finally; reference the existing signoutThunk symbol and the setIsDeleting state
updater in the account deletion handler to locate and modify the code.
🧹 Nitpick comments (2)
src/components/pages/account-deletion/accountDeletionPage.tsx (1)

32-36: 로딩 상태 해제 경로 보강 권장

성공 후 네비게이션 실패 등 예외 상황에서 isDeleting이 true로 남을 수 있으니 finally에서 해제하는 편이 안전합니다.

♻️ 제안 수정
   try {
     setIsDeleting(true)
     await dispatch(signoutThunk())
     alert('계정이 성공적으로 삭제되었습니다.')
-    router.push('/entry')
+    router.replace('/entry')
   } catch (error) {
     console.error('계정 삭제 실패:', error)
     alert('계정 삭제 중 오류가 발생했습니다. 다시 시도해주세요.')
-    setIsDeleting(false)
+  } finally {
+    setIsDeleting(false)
   }
src/app/account-deletion/page.tsx (1)

1-6: 불필요한 use client 제거로 서버 컴포넌트 유지 권장

이 페이지는 훅을 사용하지 않는 단순 래퍼라서 서버 컴포넌트로 두면 번들/SSR 측면에서 이점이 있습니다. AccountDeletionPage는 클라이언트 컴포넌트로 유지되어도 문제 없습니다.

♻️ 제안 수정
-'use client'
-
 import AccountDeletionPage from '@/components/pages/account-deletion/accountDeletionPage'

 export default function Page() {
   return <AccountDeletionPage />
 }

Comment on lines +27 to +31
try {
setIsDeleting(true)
await dispatch(signoutThunk())
alert('계정이 성공적으로 삭제되었습니다.')
router.push('/entry')
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's find signoutThunk and understand what it does
rg -n "signoutThunk|signoutApi" -A 10 -B 2

Repository: ValanSee/ValanSe_Web

Length of output: 4060


🏁 Script executed:

# Search for account deletion, withdrawal, or termination related functions
rg -n "delete.*account|account.*delete|withdraw|탈퇴|deleteAccount|accountDeletion" -A 5 -B 2

Repository: ValanSee/ValanSe_Web

Length of output: 1342


🏁 Script executed:

# Look at the full implementation of the accountDeletionPage file to understand context
cat -n src/components/pages/account-deletion/accountDeletionPage.tsx

Repository: ValanSee/ValanSe_Web

Length of output: 6914


signoutThunk의 이름을 개선하고 상태 관리를 일관되게 처리하세요

signoutThunk는 실제로 /auth/withdraw 엔드포인트를 호출하여 계정 삭제를 수행합니다. 그러나 함수명 "signout"은 로그아웃을 의미하므로, 유지보수 시 개발자가 혼동하기 쉽습니다. 함수를 deleteAccountThunk로 이름 변경하거나 명확한 주석을 추가하여 실제 삭제 작업을 수행함을 명시하세요.

추가로 isDeleting 상태를 성공 시에도 리셋하도록 finally 블록을 추가하여 상태 관리를 일관되게 처리하세요:

제안 변경
try {
  setIsDeleting(true)
  await dispatch(signoutThunk())
  alert('계정이 성공적으로 삭제되었습니다.')
  router.push('/entry')
} catch (error) {
  console.error('계정 삭제 실패:', error)
  alert('계정 삭제 중 오류가 발생했습니다. 다시 시도해주세요.')
} finally {
  setIsDeleting(false)
}
🤖 Prompt for AI Agents
In `@src/components/pages/account-deletion/accountDeletionPage.tsx` around lines
27 - 31, The handler currently dispatches signoutThunk (which actually calls
/auth/withdraw) and sets isDeleting only on entry; rename signoutThunk to a
clearer name like deleteAccountThunk (or add a clear comment above signoutThunk)
and update its import/usages in this component, and wrap the dispatch in a
try/catch/finally around setIsDeleting so errors are handled (log and show an
alert in catch) and setIsDeleting(false) is always executed in finally;
reference the existing signoutThunk symbol and the setIsDeleting state updater
in the account deletion handler to locate and modify the code.

@topeanut topeanut merged commit a180ca7 into develop Jan 26, 2026
4 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.

1 participant