Skip to content

Conversation

@0juicy
Copy link
Member

@0juicy 0juicy commented Dec 17, 2025

⚒️ 작업 내용

  • API 요청 구조 변경으로 인한 인증 번호 발송 오류 문제를 해결합니다.
  • 비밀번호 찾기, 회원가입 이메일 인증을 구분하기 위한 type을 추가합니다.

Summary by CodeRabbit

  • New Features

    • 이메일 인증에 인증 유형(일반 이메일 / 임시 비밀번호) 옵션 추가 — 용도에 따라 발송 방식 선택 가능.
    • 비밀번호 찾기 과정에 임시 비밀번호 인증 흐름(인증 코드 입력 후 재설정) 추가.
  • Refactor

    • 이메일 입력/인증 UI가 인증 유형과 모드를 받아 처리하도록 개선되어 회원가입·비밀번호 찾기 흐름을 분리.
    • 인증 요청 페이로드에 인증 유형이 반영되어 일관된 처리 지원.

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

@0zuth 코드 확인 및 검증 부탁드립니다
@0juicy 0juicy added the critical high, 1st label Dec 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

이 PR은 이메일 인증 흐름에 인증 유형("EMAIL" | "TEMPORARY_PASSWORD")과 비밀번호 재설정 시 필요한 code 필드를 도입하고, 훅, API, UI, 페이지 로직을 해당 구조로 갱신합니다.

Changes

코호트 / 파일(들) 변경 요약
타입 정의
src/entities/auth/DTO.d.ts
ResetPasswordRequestcode: string 필드 추가. 새 인터페이스 SendEmailCertificationRequest 추가(필드: email: string, certificationType: "EMAIL" | "TEMPORARY_PASSWORD").
훅 레이어
src/entities/auth/hooks/useEmailCertification.tsx
useSendEmailCertification 뮤테이션의 변수 타입을 string → `{ email: string; certificationType?: "EMAIL"
API 계층
src/entities/user/api.ts
SendEmailCertificationRequest를 import하고 `sendEmailCertification(email: string, certificationType: "EMAIL"
페이지 통합
src/pages/auth/find-password.tsx
비밀번호 찾기 페이지에서 1단계 EmailFormcertificationType="TEMPORARY_PASSWORD" 전달. 2단계 EmailCertificationFormmode="findPassword" 전달; 기존 useResetPassword 사용처 제거(주석 처리/noop).
UI 컴포넌트 — EmailForm
src/widgets/auth/ui/EmailForm.tsx
EmailFormProps 인터페이스 추가. EmailForm에 `certificationType?: "EMAIL"
UI 컴포넌트 — EmailCertificationForm
src/widgets/auth/ui/EmailCertificationForm.tsx
EmailCertificationFormProps.onNext 시그니처를 () => void(certification?: string) => void로 변경. `mode?: "signup"

Sequence Diagram(s)

sequenceDiagram
    participant User as 사용자
    participant UI as EmailCertificationForm
    participant HookCheck as useCheckEmailCertification
    participant HookReset as useResetPassword
    participant API as server

    User->>UI: 인증 코드 입력 후 제출
    alt mode = "signup"
        UI->>HookCheck: mutate({ email, certification })
        HookCheck->>API: POST /check-email { email, certification }
        API-->>HookCheck: 검증 결과
        HookCheck-->>UI: onSuccess(valid)
        UI->>User: 다음 단계(onNext(certification))
    else mode = "findPassword"
        UI->>HookReset: mutate({ email, code: certification })
        HookReset->>API: POST /reset-password { email, code }
        API-->>HookReset: 성공/오류
        HookReset-->>UI: onSuccess(response)
        UI->>User: 다음 단계(onNext(certification))
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • 주의할 파일/영역:
    • src/widgets/auth/ui/EmailCertificationForm.tsx — mode 분기와 pending 상태 결합 로직 확인
    • src/entities/auth/DTO.d.ts — 타입 이름과 필드(certificationType, code) 일관성 검토
    • 훅과 API 경계 타입(제네릭) 및 기본값("EMAIL") 전달 방식 점검
    • 페이지(find-password.tsx)에서의 prop 전달 및 기존 useResetPassword 제거 영향 확인

🐰 깡충깡충 코드 숲을 건너,
타입 한 줌 들고 길을 나섰네.
이메일도, 임시비번도,
작은 코드 하나로 맞이하고,
훅과 API가 손잡아 전해주네 ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 명확하게 요약하고 있습니다. 비밀번호 찾기와 회원가입의 이메일 인증 타입 구분이라는 핵심 변경사항을 정확히 반영합니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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

@0juicy 0juicy added Fix and removed critical high, 1st labels Dec 17, 2025
@0juicy 0juicy changed the title 비밀번호 찾기와 회원가입 이메일 인증 타입 구분 비밀번호 찾기, 회원가입 이메일 인증 타입 구분 Dec 17, 2025
@0juicy 0juicy changed the title 비밀번호 찾기, 회원가입 이메일 인증 타입 구분 비밀번호 찾기, 회원가입 이메일 인증 분기 처리 Dec 17, 2025
@0juicy
Copy link
Member Author

0juicy commented Dec 17, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@0juicy 0juicy changed the title 비밀번호 찾기, 회원가입 이메일 인증 분기 처리 비밀번호 찾기, 회원가입 이메일 인증 타입 구분 Dec 17, 2025
Copy link

@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: 0

🧹 Nitpick comments (1)
src/widgets/auth/ui/EmailCertificationForm.tsx (1)

40-62: mode 기반 분기 로직이 명확하고 올바르게 구현되었습니다.

findPassword 모드에서는 resetPassword를 호출하고, 그 외에는 checkEmail로 인증번호를 검증합니다. 두 플로우 모두 성공 시 onNext를 호출하여 일관성을 유지합니다.

선택적 개선사항: 현재 하나의 컴포넌트가 두 가지 다른 플로우를 처리합니다. 향후 로직이 더 복잡해지면 SignupCertificationFormPasswordResetCertificationForm으로 분리하는 것을 고려해볼 수 있습니다.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ab431a and 7d91c44.

📒 Files selected for processing (6)
  • src/entities/auth/DTO.d.ts (2 hunks)
  • src/entities/auth/hooks/useEmailCertification.tsx (1 hunks)
  • src/entities/user/api.ts (2 hunks)
  • src/pages/auth/find-password.tsx (1 hunks)
  • src/widgets/auth/ui/EmailCertificationForm.tsx (3 hunks)
  • src/widgets/auth/ui/EmailForm.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/widgets/auth/ui/EmailForm.tsx
🧰 Additional context used
🧬 Code graph analysis (4)
src/widgets/auth/ui/EmailCertificationForm.tsx (3)
src/entities/auth/hooks/useCheckEmailCertification.tsx (1)
  • useCheckEmailCertification (9-29)
src/entities/auth/api.ts (1)
  • resetPassword (257-272)
src/entities/auth/hooks/useResetPassword.tsx (1)
  • useResetPassword (16-45)
src/pages/auth/find-password.tsx (2)
src/widgets/auth/ui/EmailForm.tsx (1)
  • EmailForm (21-58)
src/widgets/auth/ui/EmailCertificationForm.tsx (1)
  • EmailCertificationForm (22-79)
src/entities/user/api.ts (2)
src/entities/auth/DTO.d.ts (1)
  • SendEmailCertificationRequest (62-65)
src/shared/config/api.ts (1)
  • API_PATHS (2-98)
src/entities/auth/hooks/useEmailCertification.tsx (1)
src/entities/user/api.ts (1)
  • sendEmailCertification (202-219)
🔇 Additional comments (8)
src/pages/auth/find-password.tsx (2)

56-58: 구현이 올바릅니다.

Step 2 핸들러가 빈 함수인 이유는 useResetPassword 훅이 성공 시 내부적으로 로그인 페이지로 네비게이션을 처리하기 때문입니다. 주석이 의도를 명확히 설명하고 있습니다.


62-72: 비밀번호 찾기 플로우 통합이 잘 구현되었습니다.

certificationType="TEMPORARY_PASSWORD"mode="findPassword" props가 올바르게 전달되어 회원가입 플로우와 명확하게 구분됩니다.

src/entities/auth/hooks/useEmailCertification.tsx (1)

10-16: mutation 타입 업데이트가 올바르게 구현되었습니다.

페이로드가 객체 구조로 변경되어 certificationType을 선택적으로 전달할 수 있습니다. API 레이어의 변경 사항과 일치하며 타입 안정성이 유지됩니다.

src/entities/auth/DTO.d.ts (2)

37-40: ResetPasswordRequestcode 필드 추가가 적절합니다.

비밀번호 재설정 시 인증 코드를 전달하기 위한 필드가 올바르게 추가되었습니다.

백엔드 API가 동일한 필드명(code)을 기대하는지 확인해주세요.


62-65: 새로운 SendEmailCertificationRequest 인터페이스가 잘 정의되었습니다.

certificationType 필드의 유니온 타입이 명확하게 정의되어 회원가입과 비밀번호 찾기 플로우를 타입 레벨에서 구분합니다.

백엔드 API가 "EMAIL" | "TEMPORARY_PASSWORD" 값을 정확히 인식하는지 확인해주세요.

src/entities/user/api.ts (1)

196-219: sendEmailCertification API 업데이트가 잘 구현되었습니다.

certificationType 매개변수가 기본값 "EMAIL"과 함께 추가되어 기존 호출과의 호환성을 유지하면서 새로운 플로우를 지원합니다. 페이로드 타입이 SendEmailCertificationRequest로 올바르게 지정되었습니다.

src/widgets/auth/ui/EmailCertificationForm.tsx (2)

16-20: props 설계가 유연하고 타입 안전합니다.

mode prop으로 두 가지 플로우를 구분하며, onNext 시그니처가 선택적 certification 매개변수를 받도록 확장되었습니다. 기본값 "signup"이 기존 동작을 유지합니다.


27-32: pending 상태 관리가 올바르게 구현되었습니다.

두 개의 mutation hook에서 각각 pending 상태를 추적하고 이를 결합하여 UI에 반영합니다. 이를 통해 어느 작업이 진행 중이든 적절히 로딩 상태를 표시합니다.

@Pinkippo Pinkippo merged commit a2321b3 into main Dec 17, 2025
2 checks passed
0juicy added a commit to 0juicy/OneByOne_FE that referenced this pull request Dec 18, 2025
…n/dev

비밀번호 찾기, 회원가입 이메일 인증 타입 구분
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants