Skip to content

Monitoring expired sessions#2590

Open
stefanocudini wants to merge 7 commits into
GeoNode:masterfrom
stefanocudini:issue_detect-session
Open

Monitoring expired sessions#2590
stefanocudini wants to merge 7 commits into
GeoNode:masterfrom
stefanocudini:issue_detect-session

Conversation

@stefanocudini

@stefanocudini stefanocudini commented Jun 26, 2026

Copy link
Copy Markdown
Member

The PR implement a new polling in 2 new epics in epics/security.js to check user session valid using getUserInfo() call
Introduce new monitoring container(in all routes) to show Dialog to inform user to go in login page:

The polling time interval can also be chosen through the new GEONODE_SETTINGS.CHECK_SESSION_INTERVAL option which defaults to 15 minutes. Use 0 value to disable the polling.

Peek.2026-06-26.16-33.mp4
Peek.2026-06-26.16-32.mp4

How to test:

open 2 window in both logged as same account and go logout in one.
The second window after some show the new Dialog to go in login page or cancel.
PS. to speed up tests change default value on
checkSessionInterval in https://github.com/stefanocudini/geonode-mapstore-client/blob/issue_detect-session/geonode_mapstore_client/client/js/epics/security.js#L42

.

logic to check session

check action

redirect on login page

reuse api

new epic gnCheckSession on action LOCATION_CHANGE, new constant LOGIN_URL

notification with button

new config var checkSessionInterval
added test for check session

added test for check session

test second notif

notify on cancel

refact Monitoring Comp as Container

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces background session monitoring to detect server-side session expiration and prompt the user to log in again. It adds new actions, epics (gnMonitorLogin, gnCheckSession), a MonitoringDialog component, and corresponding translation keys across multiple locales. Feedback on the changes highlights two critical issues: first, the goToLogin callback in MonitoringDialog.jsx may receive non-string arguments (such as event objects) when triggered by UI components, which would corrupt the redirect URL; second, using switchMap for START_LOGIN_MONITORING in security.js resets the session check timer on every page navigation, potentially preventing the check from ever running. Replacing it with exhaustMap is recommended to ensure the interval persists across navigations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread geonode_mapstore_client/client/js/containers/MonitoringDialog.jsx
Comment thread geonode_mapstore_client/client/js/epics/security.js
@stefanocudini stefanocudini force-pushed the issue_detect-session branch from c8782e5 to b168ec3 Compare June 26, 2026 15:12
@stefanocudini stefanocudini force-pushed the issue_detect-session branch from 7fe60ee to 5e08ff1 Compare June 29, 2026 09:06
@stefanocudini stefanocudini removed their assignment Jul 2, 2026
@stefanocudini stefanocudini added feature and removed enhancement New feature or request labels Jul 2, 2026
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