-
Notifications
You must be signed in to change notification settings - Fork 1
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
The head ref may contain hidden characters: "fix/#5-\uD68C\uC6D0\uAC00\uC785-\uB85C\uADF8\uC778-\uB85C\uC9C1-\uC624\uB958\uC218\uC815"
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오류 해결하느라 고생하셨습니다!!
src/main/java/com/example/eatmate/app/domain/member/service/MemberService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추가로 수정할 사항이 보여 남깁니다!
src/main/java/com/example/eatmate/app/domain/member/dto/MemberSignUpRequestDto.java
Show resolved
Hide resolved
src/main/java/com/example/eatmate/app/domain/member/dto/MemberSignUpRequestDto.java
Show resolved
Hide resolved
src/main/java/com/example/eatmate/app/domain/member/dto/MemberSignUpRequestDto.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 수정하시느라 고생 많으셨습니다! 같이 확인한 부분도 많고 수정할 부분도 크게 없어 수정에 관한 리뷰는 크게 없을 것 같습니다! 하지만 토큰에 관련하여 말씀하신 것 처럼 토큰을 헤더로 처리하는 방법, 쿠키에 저장하는 방법, 세션으로 인증하는 방법 등 다양한 방법이 있으니 가장 효율적인 방법에 대해 생각하고 채택해보는 고민을 추가적으로 해봐도 좋을 것 같습니다!! 바로 approve 하겠습니다!
71736b9
to
a187e9c
Compare
There was a problem hiding this 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void와 Void 중에서 보통 void를 사용하는 거로 알고있는데 특별히 Void를 쓴 이유가 있나요?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleGuestUser()로 따로 메소드화 하신거 좋습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
감사합니다 ㅎㅎ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
추가 사항 남겨놨습니다!
src/main/java/com/example/eatmate/app/domain/member/dto/MemberSignUpRequestDto.java
Show resolved
Hide resolved
src/main/java/com/example/eatmate/app/domain/member/service/MemberService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/example/eatmate/app/domain/member/service/MemberService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/example/eatmate/app/domain/member/service/MemberService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 !
개요
이슈에 작성된 대로 토큰 인증이 안됨, 회원가입 시 , 사용자 정보가 update안됨을 수정하였습니다.
OAuthLoginSuccessHandler 같은 경우 권한(Role)에 따라 메소드가 실행되며, 리다이렉트 경로가 다르게 지정됩니다.
구글 로그인의 경우, 이메일은 OAuth2 인증 과정에서 구글이 제공하는 사용자 정보로부터 추출되어 Spring Security의 UserDetails의 username으로 사용됩니다.
따라서 기존의 Dto의 email 필드가 요구사항에 맞지 않다고 판단되어 삭제하였습니다.
피드백 주시면 바로 반영하겠습니다.
PR 유형
어떤 변경 사항이 있나요?
PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.
📣 To Reviewers