Skip to content

Commit

Permalink
delete cookie (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeryboy authored Feb 27, 2025
1 parent 3fb9ad5 commit dfe7d71
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.wafflestudio.csereal.common.mockauth

import com.wafflestudio.csereal.core.user.database.UserEntity
import com.wafflestudio.csereal.core.user.database.UserRepository
import jakarta.servlet.http.Cookie
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.springframework.context.annotation.Profile
Expand Down Expand Up @@ -57,6 +58,11 @@ class DevAuthController(
response: HttpServletResponse
): ResponseEntity<String> {
request.getSession(false)?.invalidate()
val cookie = Cookie("JSESSIONID", null).apply {
path = "/"
maxAge = 0
}
response.addCookie(cookie)
return ResponseEntity.ok("Mock logout successful")
}
}

0 comments on commit dfe7d71

Please sign in to comment.