Skip to content

Commit

Permalink
feat: 로그아웃 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
70825 committed Jul 28, 2023
1 parent e28a766 commit caf7e4c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.funeat.auth.presentation;

import com.funeat.auth.application.AuthService;
import com.funeat.auth.dto.LoginRequest;
import com.funeat.auth.dto.SignUserDto;
import com.funeat.auth.util.AuthenticationPrincipal;
import java.net.URI;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -42,4 +44,12 @@ public ResponseEntity<Void> loginAuthorizeUser(@RequestParam("code") final Strin
.location(URI.create("/profile"))
.build();
}

@GetMapping("/api/logout")
public ResponseEntity<Void> logout(@AuthenticationPrincipal final LoginRequest loginRequest,
final HttpServletRequest request) {
request.getSession().removeAttribute("member");

return ResponseEntity.ok().build();
}
}

0 comments on commit caf7e4c

Please sign in to comment.