Skip to content

Commit

Permalink
try session in header
Browse files Browse the repository at this point in the history
  • Loading branch information
gotson committed Aug 27, 2024
1 parent 8e5652f commit 8fed7ff
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ class SecurityConfiguration(
// despite the response being exactly the same
// this happens when requesting /v1/user/profile
// Kobo error: packetdump.warning) Invalid JSON script: QVariant(Invalid) "illegal value"
// sessionManagement {
// sessionCreationPolicy = SessionCreationPolicy.IF_REQUIRED
// sessionConcurrency {
// sessionRegistry = theSessionRegistry
// maximumSessions = -1
// }
// }
sessionManagement {
sessionCreationPolicy = SessionCreationPolicy.IF_REQUIRED
sessionConcurrency {
sessionRegistry = theSessionRegistry
maximumSessions = -1
}
}

addFilterBefore<AnonymousAuthenticationFilter>(koboAuthenticationFilter())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ class SmartHttpSessionIdResolver(
request.getResolver().expireSession(request, response)
}

private fun HttpServletRequest.getResolver() = if (this.getHeader(sessionHeaderName) != null) header else cookie
private fun HttpServletRequest.getResolver() =
if (this.getHeader(sessionHeaderName) != null
|| this.servletPath.startsWith("/kobo/")
)
header
else
cookie
}

0 comments on commit 8fed7ff

Please sign in to comment.