Skip to content

Commit

Permalink
Merge pull request #123 from swm-nodriversomabus/FIX-LOGOUT-LOGIN
Browse files Browse the repository at this point in the history
fix(BE): 테스트 코드 삭제 및 필요없는 로그 제거 #114
  • Loading branch information
namhyo01 authored Oct 18, 2023
2 parents 688ec30 + 5c668bb commit 33c047e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
15 changes: 0 additions & 15 deletions src/main/java/com/example/api/auth/adapter/in/AuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,4 @@ public ResponseEntity<TokenResponseStatus> refresh(@CookieValue String access_to

return ResponseEntity.badRequest().body(TokenResponseStatus.addStatus(400,null));
}

@GetMapping("/test")
public User test(Principal principal){
User user = AuthenticationUtils.getCurrentUserAuthentication();
// UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
log.info("안녕");
log.info(user.toString());
log.info(user.getUserId().toString() );
// log.info(userDetails.getUsername());
// log.info(userDetails.getPassword());
if(user != null){
log.info(user.getUserId().toString());
}
return user;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ public class MyLogoutSuccessHandler implements LogoutSuccessHandler {
@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
//로그 아웃 성공시 ok 보내자
log.info("welcome logout success handler");
Cookie[] cookies = request.getCookies();
if(cookies != null) {
for (Cookie cookie : request.getCookies()) {
String cookieName = cookie.getName();
log.info(cookieName);
if(cookieName.equals("access_token")){
String accessToken = cookie.getValue();
log.info("access_token : {}", accessToken);
logoutUsecase.removeToken(accessToken);
}
CookieUtils.addCookie(response, cookieName, null, 0);
Expand Down

0 comments on commit 33c047e

Please sign in to comment.