From f3695807be98e6458992d97ad9b6c6e8841dfd74 Mon Sep 17 00:00:00 2001 From: inseo Date: Tue, 2 Jan 2024 20:03:47 +0900 Subject: [PATCH] =?UTF-8?q?optimize:=20=EC=9C=A0=EC=A0=80=EB=A0=88?= =?UTF-8?q?=EB=B2=A8=20=EC=BB=A4=EB=B2=84=EB=A7=81=20=EC=9D=B8=EB=8D=B1?= =?UTF-8?q?=EC=8A=A4=20=EA=B5=AC=ED=98=84=20(id,=20email,=20role)=20[4]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SouP/config/auth/dto/PrincipalDetailService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/SouP/src/main/java/Matching/SouP/config/auth/dto/PrincipalDetailService.java b/SouP/src/main/java/Matching/SouP/config/auth/dto/PrincipalDetailService.java index 3a40744..cec9b2c 100644 --- a/SouP/src/main/java/Matching/SouP/config/auth/dto/PrincipalDetailService.java +++ b/SouP/src/main/java/Matching/SouP/config/auth/dto/PrincipalDetailService.java @@ -24,13 +24,12 @@ public class PrincipalDetailService implements UserDetailsService { */ @Override public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException { - User principal = userRepository.findByEmailWithIndex(email) - .orElseThrow(UserNotFoundException::new); + Object[] principal = userRepository.findByEmailWithIndex(email); UserDetails result = org.springframework.security.core.userdetails.User.builder() - .username(principal.getEmail()) - .password(String.valueOf(principal.getId())) - .roles(principal.getRoleKey()) + .username((String) principal[0]) + .password(String.valueOf(principal)) + .roles((String) principal[2]) .build(); return result;