Skip to content

Monitoring expired sessions#2590

Merged
dsuren1 merged 6 commits into
GeoNode:masterfrom
stefanocudini:issue_detect-session
Jul 13, 2026
Merged

Monitoring expired sessions#2590
dsuren1 merged 6 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

@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 2 times, most recently 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
@giohappy

giohappy commented Jul 7, 2026

Copy link
Copy Markdown

@stefanocudini did you test the redirection back to the resource viewer? The videos only show an empty catalog.

.

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

Montoring plugin, i18n strings

rm debug

stop polling on logout

added test for check session

added test for check session

test second notif

notify on cancel

refact Monitoring Comp as Container

uncomments

disable polling on zero internval

lint

update docs

restore localConfig.json formatting from master
@stefanocudini
stefanocudini force-pushed the issue_detect-session branch from 5e08ff1 to 6a733e1 Compare July 7, 2026 13:02
@stefanocudini

stefanocudini commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

@stefanocudini did you test the redirection back to the resource viewer? The videos only show an empty catalog.

yes pass current location href as next parameter(on login page) for any pages:
stefanocudini@6a733e1#diff-d99c80271d90f798cd6f95dde9440a5325aba5282f08540393372270d6e27b96R20

@allyoucanmap
allyoucanmap requested review from dsuren1 and removed request for allyoucanmap July 7, 2026 13:26
@allyoucanmap allyoucanmap assigned dsuren1 and unassigned allyoucanmap Jul 7, 2026
@stefanocudini
stefanocudini force-pushed the issue_detect-session branch from e0cd85f to 4df7be0 Compare July 7, 2026 14:24

@dsuren1 dsuren1 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.

@stefanocudini
Kindly check these comments. Thanks!

Comment thread geonode_mapstore_client/client/js/epics/security.js Outdated
Comment thread geonode_mapstore_client/client/js/containers/MonitoringDialog.jsx Outdated
Comment thread geonode_mapstore_client/client/js/epics/security.js

@dsuren1 dsuren1 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.

@stefanocudini
Thanks for the clarification. I was actually referring to this. Could you please take a look? Thanks!

  • Before and after session valid action the user state becomes undefined
    Image

  • For example, the Add Resource button is missing due to missing permissions in security.user.perms. The same applies to other elements that rely on these permissions.
    Image

Comment thread geonode_mapstore_client/client/js/epics/security.js Outdated
@stefanocudini
stefanocudini force-pushed the issue_detect-session branch from d8ed7d3 to cc01db0 Compare July 10, 2026 09:26
@stefanocudini
stefanocudini requested a review from dsuren1 July 10, 2026 09:30
@stefanocudini

stefanocudini commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@stefanocudini Thanks for the clarification. I was actually referring to this. Could you please take a look? Thanks!

  • Before and after session valid action the user state becomes undefined
  • For example, the Add Resource button is missing due to missing permissions in security.user.perms. The same applies to other elements that rely on these permissions.

@dsuren1 Thanks a lot for the suggestion! fixed in the last commit: stefanocudini@cc01db0
and added one new test about it:
stefanocudini@c974a7b

@dsuren1
dsuren1 merged commit 322b6e2 into GeoNode:master Jul 13, 2026
1 check passed
@giohappy giohappy added this to the 5.2.0 milestone Jul 14, 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.

4 participants