-
Notifications
You must be signed in to change notification settings - Fork 0
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
[feat] 소셜 로그인 API 구현 #15
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.
고생 많으셨습니다!
|
||
@RequiredArgsConstructor | ||
@RequestMapping("/api/users") | ||
@RestController |
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.
ResponseEntity를 응답으로 반환하는 경우 ResponseBody 어노테이션이 불필요하기 때문에 Controller 어노테이션을 적용해도 좋을 것 같습니다.
public UserResponse signIn(String token, UserSignInRequest request) { | ||
Platform enumPlatform = getEnumPlatformFromStringPlatform(request.platform()); | ||
String platformId = getPlatformId(token, enumPlatform); | ||
User findUser = getUser(enumPlatform, platformId); | ||
Token issueToken = jwtProvider.issueToken(findUser.getId()); | ||
updateRefreshToken(issueToken.refreshToken(), findUser); | ||
|
||
return UserResponse.of(issueToken); | ||
} |
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.
클래스 레벨에 Transactional 어노테이션이 read only 옵션으로 적용되어 있어서 해당 클래스의 모든 public 메서드에서 변경 감지 동작이 이루어지지 않게 됩니다. 따라서 User 엔티티의 refresh token을 update 하는 과정이 정상 수행되지 않을 것 같습니다. 엔티티 데이터의 변경이 필요한 메서드 위에 read only 옵션이 적용되지 않은 Transactional 어노테이션을 추가적으로 적용하여 해결하면 좋을 것 같습니다.
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.
헉.. 오류 발견 감사합니다 :)
Related Issue 📌
close #14
Description ✔️