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

[Fix] 회원가입 로그인 로직 오류수정 #8

Merged
merged 20 commits into from
Jan 3, 2025

Conversation

seokjun01
Copy link
Contributor

@seokjun01 seokjun01 commented Jan 2, 2025

개요

  • closed #이슈

이슈에 작성된 대로 토큰 인증이 안됨, 회원가입 시 , 사용자 정보가 update안됨을 수정하였습니다.

OAuthLoginSuccessHandler 같은 경우 권한(Role)에 따라 메소드가 실행되며, 리다이렉트 경로가 다르게 지정됩니다.

구글 로그인의 경우, 이메일은 OAuth2 인증 과정에서 구글이 제공하는 사용자 정보로부터 추출되어 Spring Security의 UserDetails의 username으로 사용됩니다.

따라서 기존의 Dto의 email 필드가 요구사항에 맞지 않다고 판단되어 삭제하였습니다.

피드백 주시면 바로 반영하겠습니다.

PR 유형

어떤 변경 사항이 있나요?

  • 새로운 기능 추가
  • 버그 수정
  • CSS 등 사용자 UI 디자인 변경
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 테스트 추가, 테스트 리팩토링
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

📣 To Reviewers

@seokjun01 seokjun01 added the fix 버그 및 오류 해결 label Jan 2, 2025
@seokjun01 seokjun01 requested review from dyk-im, jj0526 and ehs208 January 2, 2025 17:54
@seokjun01 seokjun01 self-assigned this Jan 2, 2025
@seokjun01 seokjun01 changed the title Fix/#5 회원가입 로그인 로직 오류수정 [Fix] 회원가입 로그인 로직 오류수정 Jan 2, 2025
Copy link
Member

@ehs208 ehs208 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
Member

@ehs208 ehs208 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

@dyk-im dyk-im left a comment

Choose a reason for hiding this comment

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

코드 수정하시느라 고생 많으셨습니다! 같이 확인한 부분도 많고 수정할 부분도 크게 없어 수정에 관한 리뷰는 크게 없을 것 같습니다! 하지만 토큰에 관련하여 말씀하신 것 처럼 토큰을 헤더로 처리하는 방법, 쿠키에 저장하는 방법, 세션으로 인증하는 방법 등 다양한 방법이 있으니 가장 효율적인 방법에 대해 생각하고 채택해보는 고민을 추가적으로 해봐도 좋을 것 같습니다!! 바로 approve 하겠습니다!

@ehs208 ehs208 linked an issue Jan 3, 2025 that may be closed by this pull request
3 tasks
@seokjun01 seokjun01 force-pushed the fix/#5-회원가입-로그인-로직-오류수정 branch from 71736b9 to a187e9c Compare January 3, 2025 10:27
Copy link
Contributor

@jj0526 jj0526 left a comment

Choose a reason for hiding this comment

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

수고하셨어요!!

private final JwtService jwtService;

// 회원 가입 완료시 , 기본 값에서 사용자 입력값으로 업데이트 해주는 메소드
public Void completeRegistration(MemberSignUpRequestDto signUpRequestDto, UserDetails userDetails) {
Copy link
Contributor

Choose a reason for hiding this comment

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

void와 Void 중에서 보통 void를 사용하는 거로 알고있는데 특별히 Void를 쓴 이유가 있나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

api 설계하면서 , 메서드 리팩토링하면서 임시로 일관성 유지를 위해 작성하였습니다!
추후에 프론트 작업자분과 이야기해보고 변경사항 생길 수 있는 부분입니다!

// 사용자 Role 확인
if (oAuth2User.getRole() == Role.GUEST) {
log.info("회원가입이 필요한 사용자입니다. 회원가입 페이지로 이동.");
handleGuestUser(response, oAuth2User);
Copy link
Contributor

Choose a reason for hiding this comment

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

handleGuestUser()로 따로 메소드화 하신거 좋습니다!

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
Member

@ehs208 ehs208 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
Member

@ehs208 ehs208 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 !

@seokjun01 seokjun01 merged commit bb29a18 into dev Jan 3, 2025
2 checks passed
@ehs208 ehs208 deleted the fix/#5-회원가입-로그인-로직-오류수정 branch January 6, 2025 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 버그 및 오류 해결 석준
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fix] 회원가입 및 로그인 로직 오류수정
4 participants