모든 기기에서 로그아웃 추가

This commit is contained in:
2023-08-02 15:54:25 +09:00
parent 16c5c5f6b6
commit 0c106540cd
2 changed files with 20 additions and 0 deletions

View File

@@ -40,6 +40,15 @@ class MemberController(private val service: MemberService) {
ApiResponse.ok(service.logout(token.removePrefix("Bearer "), member.id!!))
}
@PostMapping("/logout/all")
fun logoutAll(
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
) = run {
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
ApiResponse.ok(service.logoutAll(member.id!!))
}
@GetMapping("/info")
fun getMemberInfo(
@RequestParam container: String?,