Skip to content

[FEAT] 소셜 로그인 API 구현#60

Open
nuj1min wants to merge 3 commits into
developfrom
feat/58-social-login
Open

[FEAT] 소셜 로그인 API 구현#60
nuj1min wants to merge 3 commits into
developfrom
feat/58-social-login

Conversation

@nuj1min

@nuj1min nuj1min commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

📌 PR 설명

  • 카카오, 네이버 소셜 accessToken 기반 로그인 흐름을 구현했습니다.
  • 기존 소셜 회원은 provider + providerId 기준으로 조회한 뒤 서비스 Access Token / Refresh Token을 발급하도록 처리했습니다.
  • 신규 소셜 회원은 temporaryToken을 발급하고 추가 프로필 작성 단계로 분기하도록 처리했습니다.
  • 소셜 추가 프로필 작성 완료 API를 추가하여 UserSocialAccount 저장 흐름을 구현했습니다.
  • 신규 소셜 회원의 temporaryToken은 Redis에 10분 TTL로 저장하도록 처리했습니다.
  • 로컬 개발 환경에서 Redis를 함께 실행할 수 있도록 docker-compose.yml에 Redis 서비스를 추가했습니다.
  • Swagger 문서 그룹 정리를 위해 사용자 API 태그를 정리했습니다.

🔗 연관된 이슈

Resolves: #58

📝 리뷰 요구사항

  • 신규 소셜 회원을 바로 가입 처리하지 않고, 추가 프로필 작성 완료 API에서 최종 가입 처리하는 흐름이 적절한지 확인 부탁드립니다.
  • temporaryToken 저장을 위해 Redis를 사용하도록 구성했는데, 로컬 개발 환경 구성 방식이 적절한지 확인 부탁드립니다.
  • JWT는 이번 PR에서 발급까지만 구현했으며, 인증 필터 및 토큰 검증은 후속 작업 브랜치에서 진행할 예정입니다.

💻 테스트 결과

  • API 테스트 완료
  • 오류 응답 정상 동작 확인
  • 잘못된 카카오/네이버 accessToken 요청 시 AUTH4011 응답 확인
  • 잘못된 temporaryToken 요청 시 AUTH4003 응답 확인
  • 실제 카카오/네이버 accessToken 기반 성공 케이스는 프론트 연동 후 확인 예정

소셜 로그인 추가 프로필 작성 API

스크린샷 2026-07-16 오전 10 45 53

소셜 로그인 API

스크린샷 2026-07-16 오전 10 47 27

@nuj1min nuj1min self-assigned this Jul 16, 2026
@nuj1min nuj1min changed the title [FEAT] 카카오 소셜 로그인 구현 #58 [FEAT] 소셜 로그인 구현 #58 Jul 16, 2026
@nuj1min nuj1min changed the title [FEAT] 소셜 로그인 구현 #58 [FEAT] 소셜 로그인 API #58 Jul 16, 2026
@nuj1min nuj1min changed the title [FEAT] 소셜 로그인 API #58 [FEAT] 소셜 로그인 API 구현#58 Jul 16, 2026
@nuj1min nuj1min changed the title [FEAT] 소셜 로그인 API 구현#58 [FEAT] 소셜 로그인 API 구현 Jul 16, 2026

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

간단한 리뷰 남겼습니다 확인 부탁드립니다!

@Transactional
public AuthResDTO.Token completeSocialSignup(AuthReqDTO.SocialSignupComplete request) {
SocialSignupTokenPayload payload = socialSignupTokenService.getPayload(request.temporaryToken());

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.

temporaryToken 검증 후 바로 SocialAccount를 저장하고 있는데, 동일한 temporaryToken으로 거의 동시에 요청이 들어오는 경우 두 요청 모두 토큰 검증을 통과한 뒤 SocialAccount를 저장할 가능성이 있어 보입니다. 현재는 회원가입 완료 후 토큰을 삭제하고 있지만 그 전에 동일 소셜 계정 존재 여부를 한 번 더 확인하는 로직이 있으면 조금 더 안전하게 처리할 수 있을 것 같습니다!

Comment thread docker-compose.yml
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-time-zone=Asia/Seoul
- --defau아lt-time-zone=Asia/Seoul

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.

이 부분 오타가 있습니다 수정 부탁드립니다!

@yangjiae12 yangjiae12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

실제 소셜 로그인 성공 케이스도 카카오/네이버 Developers에서 발급받은 accessToken으로 미리 테스트해보면 좋을 것 같습니다. 그리고 Refresh Token은 재발급 및 로그아웃 처리를 위해 후속 작업에서 Redis로 관리할 예정인지도 궁금합니다!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

현재 AuthService가 구현체 역할까지 함께 하고 있는데, 팀 컨벤션에 맞춰 AuthService 인터페이스와 AuthServiceImpl로 분리해도 좋을 것 같습니다.

);
}

private AuthResDTO.SocialLogin createNewSocialLoginResponse(SocialUserInfo socialUserInfo) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

createExistingSocialLoginResponse()와 createNewSocialLoginResponse()의 응답 DTO 생성 로직은 AuthConverter로 분리하면 서비스가 비즈니스 로직에 조금 더 집중할 수 있을 것 같습니다.

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.

[FEAT] 소셜 로그인 API 구현

3 participants