Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 회원가입/로그인 후 토큰을 반환한다. #212

Merged
merged 18 commits into from
Aug 5, 2024

Conversation

JINU-CHANG
Copy link
Contributor

@JINU-CHANG JINU-CHANG commented Aug 3, 2024

❗ Issue

✨ 구현한 기능

  • User 도메인 필드 email, deleted 추가 후 깨지는 테스트 수정했습니다.
  • JWT 토큰 생성 기능 구현했습니다.
  • 회원가입/로그인 기능 구현했습니다.
    • 카카오 서버로부터 사용자 정보를 가져온 후, 사용자가 존재하지 않으면 사용자를 새롭게 저장한 후 토큰을 반환하고, 존재하면 토큰을 바로 반환합니다.
    • 토큰은 헤더에 담아 반환합니다.
  • 외부 API(카카오 API) 사용으로 Service에서는 MockBean을, Controller에서는 MockMvc를 사용해 테스트합니다.

📢 논의하고 싶은 내용

🎸 기타

  • 테스트쪽을 중심으로 피드백 부탁드립니다~
  • application.yml 파일 수정됐습니다.
  • 추후 작업 예정 : API별 인증/인가 처리

# Conflicts:
#	backend/bang-ggood/src/main/java/com/bang_ggood/exception/ExceptionCode.java
# Conflicts:
#	backend/bang-ggood/src/main/java/com/bang_ggood/exception/ExceptionCode.java
# Conflicts:
#	backend/bang-ggood/src/main/java/com/bang_ggood/user/controller/UserController.java
#	backend/bang-ggood/src/main/java/com/bang_ggood/user/dto/request/OauthLoginRequest.java
#	backend/bang-ggood/src/main/java/com/bang_ggood/user/dto/response/OauthInfoResponse.java
#	backend/bang-ggood/src/main/java/com/bang_ggood/user/service/UserService.java
@JINU-CHANG JINU-CHANG requested review from tsulocalize, shin-jisong and tkdgur0906 and removed request for shin-jisong August 3, 2024 05:17
@JINU-CHANG JINU-CHANG self-assigned this Aug 3, 2024
@JINU-CHANG JINU-CHANG requested review from shin-jisong and removed request for shin-jisong August 3, 2024 05:17
@JINU-CHANG JINU-CHANG modified the milestone: 마일스톤 5주차 Aug 3, 2024
@JINU-CHANG JINU-CHANG changed the title 회원가입/로그인 후 토큰을 반환한다. [BE] 회원가입/로그인 후 토큰을 반환한다. Aug 3, 2024
Copy link
Contributor

@tkdgur0906 tkdgur0906 left a comment

Choose a reason for hiding this comment

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

구현하느라 고생많으셨습니다!
테스트도 잘 작성해 주신 것 같아요!
간단한 코멘트만 남겨놨습니다~

import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@ConfigurationPropertiesScan
Copy link
Contributor

Choose a reason for hiding this comment

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

ConfigurationProperties를 쓰는 부분이 있나요?
따로 이 어노테이션을 추가하신 이유가 있을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헉 ..! 저번 리뷰 반영하다 들어간 것 같네요 삭제하겠습니다!!

@Test
void login_signup() {
// given
Mockito.when(oauthClient.requestOauthInfo(new OauthLoginRequest("")))
Copy link
Contributor

Choose a reason for hiding this comment

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

OauthLoginRequest 도 Fixture로 분리하는 건 어떤가요?
불필요하다 생각하면 유지하셔도 좋습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 리뷰 반영했습니다~

Copy link
Contributor

@shin-jisong shin-jisong left a comment

Choose a reason for hiding this comment

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

제제 수고하셨습니다~ 간단한 질문들을 남겼어요!
확인하고 반영할 부분만 반영하시면 될 것 같아요

Copy link
Contributor

@shin-jisong shin-jisong left a comment

Choose a reason for hiding this comment

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

comment로 잘못 남겨서 RC로 다시 남깁니다~

@shin-jisong shin-jisong merged commit 0c0de9e into dev-be Aug 5, 2024
1 check passed
@shin-jisong shin-jisong deleted the feat/181-kakao-login branch August 5, 2024 06:29
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.

4 participants