Skip to content

이메일 인증 결과를 JSON 대신 HTML 문구로 응답 - #64

Merged
nariming merged 1 commit into
developfrom
fix/verification-email-content
Aug 12, 2026
Merged

nariming merged 1 commit into
developfrom
fix/verification-email-content

Conversation

@nariming

@nariming nariming commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

📌 관련 이슈

  • #00

🔎 What is this PR?

회원가입 시 발송되는 이메일 인증 메일의 안내 문구 및 인증 링크 처리 방식을 개선

✨ Changes

  • AuthMailService.sendVerificationEmail

    • 기존: GET /auth/verify-email?token=... 형태의 API 명세 표기와 원시 토큰 값을 메일 본문에 그대로 노출
    • 변경: app.base-url 설정값을 조합해 실제 클릭 가능한 전체 URL(https://dev.daytodo.cloud/auth/verify-email?token=...)로 안내하도록 수정
    • application.yml에 app.base-url 프로퍼티(APP_BASE_URL 환경변수, 기본값 dev 도메인) 추가
  • AuthController.verifyEmail

    • 기존: AuthResponse.EmailVerified JSON을 그대로 반환해, 메일 링크 클릭 시 브라우저에 JSON이 노출됨
    • 변경: 별도 FE 페이지 없이 컨트롤러 단에서 성공/실패 상황별 안내 문구를 담은 HTML을 직접 반환하도록 수정 (INVALID_VERIFICATION_TOKEN, EXPIRED_VERIFICATION_TOKEN 등 에러 케이스별 문구 분기 처리)
    • AuthService.verifyEmail을 비롯한 서비스 로직은 변경 없음

📷 Result


💬 To. Reviewer

  • verifyEmail 엔드포인트만 예외적으로 JSON이 아닌 HTML을 반환하도록 바꿨는데, 이 방식이 괜찮은지 확인 부탁드려요.

✅ 체크 리스트

  • base 브랜치(develop 또는 main) 최신 상태 pull 및 충돌 확인 완료
  • Reviewers 설정
  • Assignees 설정
  • Labels 설정

Summary by CodeRabbit

  • New Features
    • Email verification now displays a user-friendly HTML result page.
    • Successful verification provides clear confirmation feedback.
    • Invalid or expired verification links show understandable error messages with an appropriate client error response.

@nariming nariming added the 🐛 fix develop 브랜치에서 발생한 버그를 수정하는 작업 label Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 898fb36e-ac2b-4087-84e4-27eb84bbad9a

📥 Commits

Reviewing files that changed from the base of the PR and between 2260307 and f90b1eb.

📒 Files selected for processing (1)
  • src/main/java/com/daytodo/domain/auth/controller/AuthController.java

📝 Walkthrough

Walkthrough

The email verification endpoint now returns HTML pages. It reports successful verification and maps expired or invalid tokens to HTTP 400 responses with user-facing messages.

Changes

Email verification response

Layer / File(s) Summary
HTML verification response
src/main/java/com/daytodo/domain/auth/controller/AuthController.java
The endpoint now produces text/html and returns ResponseEntity<String>. It renders success and error pages, maps known token errors to messages, and uses HTTP 400 for verification failures.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: returning HTML text instead of JSON for the email verification result.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 fix/verification-email-content

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.

@kwonwnsduf kwonwnsduf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨습니다!

@nariming
nariming merged commit 3a7d2d2 into develop Aug 12, 2026
1 check passed
@nariming
nariming deleted the fix/verification-email-content branch August 12, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 fix develop 브랜치에서 발생한 버그를 수정하는 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants