Skip to content

fix(WebSecurityConfig): Session renewal requires sign-in, so an ended session is never told it ended - #370

Merged
hirokiterashima merged 1 commit into
WISE-Community:developfrom
Isaries:fix/session-renew-anonymous
Nov 17, 2026
Merged

hirokiterashima merged 1 commit into
WISE-Community:developfrom
Isaries:fix/session-renew-anonymous

Conversation

@Isaries

@Isaries Isaries commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

LoginController.renewSession() answers false when nobody is signed in, and the client's SessionService signs the user out when it receives false. Since the Spring Boot 3 upgrade (#311), WebSecurityConfig ends with anyRequest().authenticated(), and /api/session/renew matches none of the permitted paths, so a request whose session has already ended is redirected to the sign-in page instead of reaching the controller. The false branch can no longer be reached.

For users this means a session that has ended on the server, for example after the session timeout or a server restart, is not noticed by the page that is open. The page keeps showing the unit, and the next save or request fails instead of the user being sent to sign in again.

Changes

  • /api/session/renew is added to the permitted paths. The controller already handles an anonymous request; it only reports whether a session exists.

Test

  • New case in WebSecurityConfigAuthorizationTest: an unauthenticated GET /api/session/renew answers false. The body is checked rather than the status, because the redirect to the sign-in page is not a 403 and would pass a status check. Against the current develop it fails with expected: <false> but was: <>.
  • WebSecurityConfigAuthorizationTest (17) and LoginControllerTest pass.

… session is never told it ended

LoginController.renewSession() answers "false" when nobody is signed in,
which is how the client learns that the session has ended. Since the
Spring Boot 3 upgrade (WISE-Community#311) every path that matches no rule requires
authentication, and /api/session/renew matches none, so a request whose
session has ended is redirected to the sign-in page and never receives
"false". The path is added to the permitted paths.

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for catching this issue.

@hirokiterashima
hirokiterashima merged commit 1b1ee4b into WISE-Community:develop Nov 17, 2026
1 check passed
@hirokiterashima hirokiterashima self-assigned this Nov 17, 2026
@hirokiterashima

Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.27.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants