Skip to content

Feat: 내 정보 조회 API에 로그인 수단 및 수단별 이메일 추가 - #564

Merged
uykm merged 7 commits into
developfrom
feat/member/#563-me-login-methods
Sep 24, 2026
Merged

uykm merged 7 commits into
developfrom
feat/member/#563-me-login-methods

Conversation

@uykm

@uykm uykm commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

내 정보 조회(GET /v1/members/me) 응답에 loginMethods 필드를 추가해요. 로그인 수단과 수단별 이메일을 함께 내려줘요.
소셜 로그인 이메일은 지금까지 저장하지 않았기 때문에 member_oauth에 email 컬럼을 추가하고, 로그인할 때마다 제공자 이메일로 갱신해요.

"loginMethods": [
  { "type": "KAKAO", "email": "a@gmail.com" },
  { "type": "APPLE", "email": "abc@privaterelay.appleid.com" },
  { "type": "EMAIL", "email": "a@gmail.com" }
]

Tasks

  • DB 마이그레이션 db/pending/2609241927_member_oauth_email.sql
    • member_oauth.email VARCHAR(255) NULL 추가
    • 기존 행은 members.signup_email로 채움 (탈퇴로 익명화된 회원 제외)
    • 여러 번 실행해도 안전하고, VERIFY·ROLLBACK 섹션 포함
  • MemberOAuth / MemberOAuthEntity에 email 추가
  • MemberOAuthPersistencePort.updateEmail 추가 (값이 다를 때만 UPDATE)
  • 소셜 로그인 시 이메일 저장·갱신
    • 신규 연동: 저장할 때 이메일 포함
    • 기존 연동 / 고아 행 재연결: 로그인할 때마다 최신 이메일로 갱신
    • 대상: KakaoAuthService, AppleAuthService, MemberLoginService(웹 OAuth, 카카오 네이티브)
  • MemberDetailsResponse.loginMethods: List<LoginMethod(type, email)>
    • 소셜: member_oauth 행마다 하나 (제공자 선언 순서로 정렬)
    • EMAIL: member_credentials에 자격 증명이 있으면 마지막에 추가

ETC

⚠️ 배포 순서

애플리케이션이 ddl-auto: validate라서 마이그레이션을 먼저 적용한 뒤 배포해야 해요. 컬럼이 없으면 서버가 뜨지 않아요. 롤백할 때는 반대로 애플리케이션을 먼저 내리고 컬럼을 DROP해요.

기존 데이터 채우기 전제

소셜 계정은 signup_email과 제공자 이메일이 같은 회원에게만 연동되기 때문에(findAllBySignupEmail로 매칭), 연동 시점의 이메일은 signup_email과 같아요. 연동 뒤에 제공자 쪽 이메일이 바뀐 경우는 다음 로그인 때 갱신돼요.

검증

  • MySQL 8.0 임시 컨테이너에서 마이그레이션 두 번 실행(멱등성), VERIFY, ROLLBACK 확인
  • 전체 테스트 72개 통과
  • 로그인 흐름과 /me 응답은 실제 호출로 확인하지 않았어요

관련 PR

#562와 마찬가지로 db/pending을 사용해요. 파일이 겹치지 않고 선행 스크립트도 없어서 어느 PR이 먼저 머지돼도 괜찮아요.

🤖 Generated with Claude Code

uykm and others added 3 commits September 24, 2026 19:00
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@uykm uykm self-assigned this Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c811d466-e130-4f29-a0e9-38734ef89499

📥 Commits

Reviewing files that changed from the base of the PR and between 485a9dc and a969861.

📒 Files selected for processing (6)
  • application/src/main/kotlin/core/application/member/application/service/MemberQueryService.kt
  • application/src/main/kotlin/core/application/member/application/service/oauth/MemberOAuthService.kt
  • application/src/main/kotlin/core/application/member/presentation/response/MemberDetailsResponse.kt
  • domain/src/main/kotlin/core/domain/member/port/outbound/MemberOAuthPersistencePort.kt
  • persistence/src/main/kotlin/core/persistence/member/repository/oauth/MemberOAuthJpaRepository.kt
  • persistence/src/main/kotlin/core/persistence/member/repository/oauth/MemberOAuthRepository.kt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

회원별 OAuth 제공자와 이메일 자격 증명 여부를 조회해 memberMe 응답에 로그인 수단 목록을 추가합니다. MemberDetailsResponse에 loginMethods 필드와 API 문서 스키마를 추가합니다.

Changes

회원 로그인 수단 조회

Layer / File(s) Summary
회원별 OAuth 제공자 조회
domain/src/main/kotlin/core/domain/member/port/outbound/MemberOAuthPersistencePort.kt, persistence/src/main/kotlin/core/persistence/member/repository/oauth/*, application/src/main/kotlin/core/application/member/application/service/oauth/MemberOAuthService.kt
회원 ID로 OAuth 연결 목록을 조회하는 포트와 저장소 메서드를 추가합니다. MemberOAuthService는 제공자 목록의 중복을 제거하고 오름차순으로 정렬합니다.
로그인 수단 응답 구성
application/src/main/kotlin/core/application/member/application/service/MemberQueryService.kt, application/src/main/kotlin/core/application/member/presentation/response/MemberDetailsResponse.kt
memberMe에 loginMethods를 추가합니다. OAuth 제공자 목록에 이메일 자격 증명이 있으면 EMAIL을 포함합니다. 응답 필드와 팩토리 메서드, API 문서 스키마를 갱신합니다.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant MemberQueryService
  participant MemberOAuthService
  participant MemberOAuthRepository
  participant MemberOAuthJpaRepository
  participant MemberCredentialPersistencePort
  participant MemberDetailsResponse
  MemberQueryService->>MemberOAuthService: findProvidersByMemberId(memberId)
  MemberOAuthService->>MemberOAuthRepository: findAllByMemberId(memberId)
  MemberOAuthRepository->>MemberOAuthJpaRepository: findAllByMemberId(memberId.value)
  MemberOAuthJpaRepository-->>MemberOAuthRepository: OAuth 연결 목록
  MemberOAuthRepository-->>MemberOAuthService: MemberOAuth 목록
  MemberOAuthService-->>MemberQueryService: 중복 제거 및 정렬된 제공자 목록
  MemberQueryService->>MemberCredentialPersistencePort: 이메일 자격 증명 존재 여부 조회
  MemberQueryService->>MemberDetailsResponse: 로그인 수단 목록 전달
Loading

Suggested reviewers: blackbean99

Merge Risk: ⚪ Minimal · up to a9698

The login-method response matches the currently supported OAuth providers and email credentials. No actionable merge-blocking risk was established for this change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 GET /v1/members/me 응답에 로그인 수단을 추가하는 주요 변경을 명확하게 설명합니다. 다만 변경 요약에는 수단별 이메일 추가 내용이 확인되지 않습니다.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@uykm uykm changed the title Feat : 내 정보 조회 API에 로그인 수단 목록 추가 [Feat] 내 정보 조회 API에 로그인 수단 목록 추가 Sep 24, 2026
@uykm
uykm requested review from hwistlezz and removed request for heeun98 September 24, 2026 10:05
uykm and others added 4 commits September 24, 2026 19:29
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@uykm uykm changed the title [Feat] 내 정보 조회 API에 로그인 수단 목록 추가 Feat : 내 정보 조회 API에 로그인 수단 및 수단별 이메일 추가 Sep 24, 2026

@hwistlezz hwistlezz 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.

연휴인데 고생 많으셧습니다~!

이번 PR에 대해서는 수정 의견은 없습니다!


다만, 다른 얘기이긴 한데,,
기존 이메일 로그인 흐름도 보다가 궁금한 부분이 있어서 여쭤봅니다.!

OAtuh로만 회원가입한 (비밀번호가 없는) 회원에 대해, 같은 이메일 주소와 새로운 비밀번호를 통해 비밀번호를 등록하고 로그인할 수 있는 걸로 이해했어요. (회원 상태와 탈퇴 여부만 검사하고, 요청자가 계정 주인인지는 확인하는 로직은 없는 것 같아요.!)

이메일 주소를 아는 다른 사람(악의적인 사용자)이 해당 계정에 접근할 수 있을 것 같은데, 제가 놓친 본인 확인 절차가 있을까요??

@uykm uykm changed the title Feat : 내 정보 조회 API에 로그인 수단 및 수단별 이메일 추가 [Feat] 내 정보 조회 API에 로그인 수단 및 수단별 이메일 추가 Sep 24, 2026
@uykm

uykm commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

이메일 주소를 아는 다른 사람(악의적인 사용자)이 해당 계정에 접근할 수 있을 것 같은데, 제가 놓친 본인 확인 절차가 있을까요??

@hwistlezz
아 넵 그 그부분은 저도 확인은 했었는데, 나중에 보완을 하든지 해야할 것 같아요!

@uykm
uykm merged commit a3efd84 into develop Sep 24, 2026
2 checks passed
@uykm
uykm deleted the feat/member/#563-me-login-methods branch September 24, 2026 13:34
@uykm uykm changed the title [Feat] 내 정보 조회 API에 로그인 수단 및 수단별 이메일 추가 Feat: 내 정보 조회 API에 로그인 수단 및 수단별 이메일 추가 Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants