-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bug버그(또는 에러)가 발생하여 수정이 필요합니다.버그(또는 에러)가 발생하여 수정이 필요합니다.
Description
🐞 버그 리포트
😕 버그 설명
@AuthenticationPrincipal애노테이션으로 받아온UserDetails객체가 null일 수 있음.- 하지만 null인 상태로 비즈니스 로직에 들어가면
NullPointException등 오류를 일으킴. - 만약 null이 받아와졌다면 403 상태코드를 반환하는 처리가 필요함.
♾️ 재현 방법
StudentApiController에 로그인 후 요청을 보낼 때 토큰 정보를 담지 않고 보내면 됨.
🤔 기대한 동작
- 성공:
UserDetails에서 username 필드를 가져와 비즈니스 로직에서 사용.
UserDetails가 null이라서 username필드를 가져올 수 없음. 따라서 null값이 비즈니스 로직에 들어감.NullPointException이 발생함.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug버그(또는 에러)가 발생하여 수정이 필요합니다.버그(또는 에러)가 발생하여 수정이 필요합니다.