[블로그] Security session 수정 + 회원 정보 수정

JoMinJun·2021년 4월 27일
0

springboot

목록 보기
36/38
  1. controller
  2. view -> 수정정보 ajax 로 전송
  3. restcontroller
  4. service
  5. db 저장

session 수정

@PutMapping("/user")
	public ResponseDto<Integer> update(@RequestBody User user) {
		System.out.println("save 호출");
		userService.회원수정(user);
		
		Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(user.getUsername(), user.getPassword()));
		SecurityContextHolder.getContext().setAuthentication(authentication);
		
		return new ResponseDto<Integer>(HttpStatus.OK.value(),1); 
		
profile
기술정리

0개의 댓글

관련 채용 정보