-
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
GTB-46 [feat] 사용자 인증 로직 변경 #46
Conversation
[GTB-46] chore: 미사용 import문 제거
LGTM! |
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.
코드 자체에서 수정해야할 점이 발견되지는 못했습니다!
괜찮으시다면 어떤 플로우로 인증이 이루어지고, 인증이 필요한 기능의 경우 어떤 식으로 사용해야하는지 pr에 남겨주시면 더더더더 감사할거 같습니다.
많은 수정을 요했을텐데 구현하시느라 고생하셨습니다 :)
.orElseThrow(AdminNotFoundException::new) | ||
.getPub(); | ||
return ResponseEntity.ok(getWaitings.excute(pub)); | ||
public ResponseEntity<PubWaitingListResponse> getWaiting(@AuthenticationPrincipal AuthDetails authDetails) { |
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.
해당 어노테이션은 시큐리티가 저장하고 있는 Authentication
객체를 참조하는 방법 중 하나입니다!
쉽게 말해, AuthDetails
(통상적으로는 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.
배워갑니다 !! 고생하셨습니다
1. 무슨 이유로 코드를 변경했나요?
AuthenticationPrincipal
을 통한 인증 로직을 구현하기 위해 코드를 변경하였습니다.2. 어떤 위험이나 장애를 발견했나요?
3. 관련 스크린샷을 첨부해주세요.
4. 완료 사항
5. 추가 사항
인증 플로우
AuthenticationPrincipal
Authentication
의Principal
을 사용하기 위한 어노테이션입니다.CustonUserDetails
CustomUserDetailsService
자세한 내용은 https://wildeveloperetrain.tistory.com/324 를 참고해주시면 더욱 좋을 듯 합니다!
감사합니다 😄