Skip to content

Commit

Permalink
#3 fix : 로그아웃 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Suanna01 committed Apr 17, 2023
1 parent 884727e commit 721c55e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/zatch/zatchserver/ResponseMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ResponseMessage {
public static final String CREATED_USER = "회원 가입 성공";
public static final String UPDATE_USER = "회원 정보 수정 성공";
public static final String DELETE_USER = "회원 탈퇴 성공";
public static final String LOGOUT_SUCCESS = "로그아웃 성공";
public static final String USER_TOWN_SUCCESS = "회원 동네 설정 성공";
public static final String MY_PROFILE_SUCCESS = "내 프로필 불러오기 성공";
public static final String MYPAGE_SUCCESS = "마이페이지 불러오기 성공";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

Expand All @@ -30,7 +33,8 @@ public class UserController {
private final AuthService authService;

@ApiResponses(value = {
@ApiResponse(code = 200, message = "Success", response = GetUserResDto.class, examples = @Example(@ExampleProperty(value = "{'property1': 'value1', 'property2': 'value2'}", mediaType = MediaType.APPLICATION_JSON_VALUE)))
@ApiResponse(code = 200, message = "Success", response = GetUserResDto.class,
examples = @Example(@ExampleProperty(value = "{'property1': 'value1', 'property2': 'value2'}", mediaType = MediaType.APPLICATION_JSON_VALUE)))
})
@PostMapping("/new")
@ApiOperation(value = "회원가입", notes = "회원가입 API", produces = MediaType.APPLICATION_JSON_VALUE)
Expand Down Expand Up @@ -89,7 +93,7 @@ public ResponseEntity postUser(@RequestBody PostUserReqDto postUserReqDto, HttpS

@GetMapping("/logout")
@ApiOperation(value="로그아웃", notes = "로그아웃 API")
public ResponseEntity logout(HttpServletRequest request) throws Exception{
public ResponseEntity logout(HttpServletRequest request, HttpServletResponse response) throws Exception{
try {
HttpSession session = request.getSession();
session.invalidate();
Expand Down

0 comments on commit 721c55e

Please sign in to comment.