Add principal debug header on room create
Some checks failed
build-and-deploy / build-deploy (push) Failing after 21s
Some checks failed
build-and-deploy / build-deploy (push) Failing after 21s
This commit is contained in:
@@ -164,8 +164,15 @@ class Rooms(
|
||||
fun createRoom(
|
||||
@PathVariable propertyId: UUID,
|
||||
@AuthenticationPrincipal principal: MyPrincipal?,
|
||||
@javax.servlet.http.HttpServletResponse response: javax.servlet.http.HttpServletResponse,
|
||||
@org.springframework.web.bind.annotation.RequestHeader(value = "X-Debug-Auth", required = false)
|
||||
debugAuth: String?,
|
||||
@RequestBody request: RoomUpsertRequest
|
||||
): RoomResponse {
|
||||
if (debugAuth == "1") {
|
||||
response.setHeader("X-Principal-Present", (principal != null).toString())
|
||||
response.setHeader("X-Principal-Id", principal?.userId?.toString() ?: "none")
|
||||
}
|
||||
requirePrincipal(principal)
|
||||
propertyAccess.requireMember(propertyId, principal!!.userId)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user