목록MemberContext (2)
개발 무지렁이
[HomeController.java] (1) Principal 이용 @Controller @RequiredArgsConstructor public class HomeController { @PreAuthorize("isAuthenticated()") @GetMapping("/currentUserOrigin") @ResponseBody public Principal currentUserOrigin(Principal principal) { return principal; } } (2) @AuthenticationPrincipal 이용 @Controller @RequiredArgsConstructor public class HomeController { @GetMapping("/currentUser") @R..
[MemberContext.java] @Getter public class MemberContext extends User { private final Long id; private final String profileImgUrl; public MemberContext(Member member, List authorities) { super(member.getUsername(), member.getPassword(), authorities); this.id = member.getId(); this.profileImgUrl = member.getProfileImgUrl(); } } [MemberSecurityService.java] @Service @RequiredArgsConstructor public ..