-
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
[리팩토링] Post, Service 코드 개선 및 테스트 코드 추가 #129
base: develop
Are you sure you want to change the base?
Changes from 1 commit
27d1153
899be5d
b92fe48
24772fd
d9c0211
ad4d613
7cb411b
08b55ac
6cb3aba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,4 +89,9 @@ public User findByUserEmail(String email){ | |
return userRepository.findByEmail(email) | ||
.orElseThrow(() -> new EntityNullException(ErrorInfo.USER_NULL)); | ||
} | ||
|
||
|
||
public Long getUserInfoFromToken(User user){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @currentuser는 @AuthenticationPrincipal을 기반으로 만든건데 스프링 시큐리티에서 인증된 사용자 정보는 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 옹 @currentuser 보니까 @AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : user") 이 부분에서 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 익명 사용자 접근은 어차피 권한에 따라 SecurityConfig filter에서 걸러지기 때문에 null 신경 안써도 될 꺼같아 |
||
return (user != null)? user.getUserIdx(): 0L; | ||
} | ||
} |
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.
여기는 AccessDeniedException을 던지는게 더 적절할 듯