Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (26)
워크스루이메일 인증 기능을 구현하는 종합적인 변경사항입니다. 회원가입 시 인증 토큰을 생성하고 인증 메일을 발송하며, 사용자가 토큰을 통해 이메일을 인증할 수 있도록 합니다. 인증되지 않은 사용자는 노트 작성을 제한받습니다. 변경사항
시퀀스 다이어그램sequenceDiagram
participant User as 사용자
participant Frontend as 프론트엔드
participant Backend as 백엔드 (Auth)
participant Mail as 메일 서비스
participant DB as 데이터베이스
User->>Frontend: 회원가입 (이메일, 비밀번호)
Frontend->>Backend: POST /auth/register
Backend->>DB: 새 사용자 생성 (emailVerifiedAt = null)
Backend->>Backend: 토큰 생성 및 해싱
Backend->>DB: email_verification_tokens 저장
Backend->>Mail: 인증 토큰으로 이메일 발송
Mail-->>User: 인증 링크 메일 수신
Frontend->>Frontend: /verify-email로 이동
User->>Frontend: 메일의 링크 클릭 또는 토큰 입력
Frontend->>Backend: POST /auth/verify-email {token}
Backend->>DB: 토큰 조회 및 검증
alt 토큰 유효
Backend->>DB: emailVerifiedAt = now()로 업데이트
Backend->>DB: 토큰을 used 표시
Backend-->>Frontend: 201 Success
Frontend->>User: 인증 완료 메시지
else 토큰 무효/만료
Backend-->>Frontend: 400 Bad Request
Frontend->>User: 오류 표시 및 재발송 옵션
end
sequenceDiagram
participant User as 사용자
participant Frontend as 프론트엔드
participant Backend as 백엔드 (Auth)
participant Mail as 메일 서비스
participant DB as 데이터베이스
User->>Frontend: 노트 작성 시도
Frontend->>Backend: POST /notes {content}
Backend->>Backend: JwtAuthGuard 검증
Backend->>Backend: EmailVerifiedGuard 검증
alt emailVerifiedAt 있음
Backend->>DB: 노트 생성
Backend-->>Frontend: 201 Created
else emailVerifiedAt 없음
Backend-->>Frontend: 403 Forbidden
Frontend->>User: 이메일 인증 필요 안내
User->>Frontend: 재발송 버튼 클릭
Frontend->>Backend: POST /auth/resend-verification
Backend->>DB: 기존 토큰 무효화
Backend->>Backend: 새 토큰 생성
Backend->>DB: 새 토큰 저장
Backend->>Mail: 새 인증 이메일 발송
Mail-->>User: 새 인증 링크 메일
end
예상 코드 리뷰 난이도🎯 4 (복잡함) | ⏱️ ~50분 관련 가능성 있는 PR
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test plan
Summary by CodeRabbit
Release Notes
New Features
Tests