Skip to content

Commit

Permalink
#3 feat : 로그아웃
Browse files Browse the repository at this point in the history
  • Loading branch information
Suanna01 committed Mar 5, 2023
1 parent 8ab9ae9 commit dda187f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/zatch/zatchserver/controller/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.*;

@RequiredArgsConstructor
Expand Down Expand Up @@ -45,6 +47,14 @@ public GetUserReqDto getLogin(@PathVariable("email") String email) {
return new GetUserReqDto(email);
}

@GetMapping("/logout")
@ApiOperation(value="로그아웃", notes = "로그아웃 API")
public String logout(HttpServletRequest request) throws Exception{
HttpSession session = request.getSession();
session.invalidate();
return "logout";
}


@PatchMapping("/{userId}/nickname")
@ApiOperation(value = "회원 닉네임 수정", notes = "회원 닉네임 수정 API")
Expand Down

0 comments on commit dda187f

Please sign in to comment.