diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/user/User.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/user/User.java index ffb6b5f..1868219 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/user/User.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/domain/user/User.java @@ -59,7 +59,7 @@ public static User create(UserCommand.Create command) { return User.builder() .nickname(command.getNickname()) .email(command.getEmail()) - .password(command.getPassword()) + .password(command.getEncodedPassword()) .role(Role.USER) .provider(null) .authToken(null) @@ -75,7 +75,7 @@ public static User createManager(UserCommand.Create command) { return User.builder() .nickname(command.getNickname()) .email(command.getEmail()) - .password(command.getPassword()) + .password(command.getEncodedPassword()) .role(Role.MANAGER) .provider(null) .authToken(null) diff --git a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/global/security/JwtProvider.java b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/global/security/JwtProvider.java index fe53ff3..a3d8ddf 100644 --- a/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/global/security/JwtProvider.java +++ b/zzansuni-api-server/app/src/main/java/org/haedal/zzansuni/global/security/JwtProvider.java @@ -37,11 +37,8 @@ public Authentication authenticate(Authentication authentication) throws Authent JwtUser jwtUser = jwtUtils.getJwtUser(JwtToken.ValidToken.of(token)); Set authorities = Set.of(new SimpleGrantedAuthority(jwtUser.getRole().name())); - // 검증 후 SecurityContextHolder에 인증정보를 저장 - Authentication jwtUserToken = new UsernamePasswordAuthenticationToken(jwtUser, null, authorities); - SecurityContextHolder.getContext().setAuthentication(jwtUserToken); - - return jwtUserToken; + // 검증 후 인증정보 Authentication 객체를 반환 + return new UsernamePasswordAuthenticationToken(jwtUser, null, authorities); } /**