현재 로그인된 사용자 정보 수정한후(Service) 수정된 정보로 재할당
@PutMapping("/auth/updateProc")
public ResponseDto<Integer> update(@RequestBody User user){
service.update(user);
// Service 종료 -> 트랜잭션 종료 -> DB변경완료 (commit)
// 세션 등록
// 1. config에 Bean등록한 AuthenticationManager를 DI한 후 새로운 토큰을 발행해서 authentication 객체를 만든다.
Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword()));
// 2. 새로 생성한 authentication 객체를 SecurityContextHolder안에 SecurityContext안에 set한다.
SecurityContextHolder.getContext().setAuthentication(authentication);
return new ResponseDto<Integer>(HttpStatus.OK.value(), 1);
}