Skip to content

Commit

Permalink
fix(ApplicationConfig): 비밀번호 암호화하지 않고 UserDetails 를 설정하고 반환한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehBeak committed Aug 23, 2023
1 parent 2b2791e commit 3cb449b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ public class AuthenticationController {
private final AuthenticationUseCase authenticationUseCase;

@PostMapping("/authenticate")
public ResponseEntity authenticate(
@RequestBody AuthenticationRequest request
) {
public ResponseEntity authenticate(@RequestBody AuthenticationRequest request) {
AuthenticationResponse response = authenticationUseCase.authenticate(request);
return ResponseEntity.ok(SuccessResponse.create200SuccessResponse(response));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public UserDetailsService userDetailsService() {
User user = findUserPort.findUser(username);

return org.springframework.security.core.userdetails.User.builder()
.username(user.getUserEmail())
.password(passwordEncoder().encode(user.getUserPassword()))
.authorities(new SimpleGrantedAuthority(user.getRole().name()))
.build();
.username(user.getUserEmail())
.password(user.getUserPassword())
.authorities(new SimpleGrantedAuthority("ROLE_" + user.getRole()))
.build();
};

}
Expand Down

0 comments on commit 3cb449b

Please sign in to comment.