Skip to content

Commit

Permalink
[Fix]: 유저생성 pwd, 시큐리티 코드삭제 누락 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
bayy1216 committed Jul 7, 2024
1 parent bdac9c2 commit 8e74657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ public Authentication authenticate(Authentication authentication) throws Authent
JwtUser jwtUser = jwtUtils.getJwtUser(JwtToken.ValidToken.of(token));
Set<SimpleGrantedAuthority> 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);
}

/**
Expand Down

0 comments on commit 8e74657

Please sign in to comment.