mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Logout the pgAdmin session when no user activity of mouse move, click or keypress. Fixes #5000.
Introduced two config params: 1. USER_INACTIVITY_TIMEOUT - Interval in seconds for the timeout. Default is 0-Zero which means disabled. 2. OVERRIDE_USER_INACTIVITY_TIMEOUT - If set to true, tools like query tool or debugger will override USER_INACTIVITY_TIMEOUT and will not allow the application to timeout if a query is running for a long time.
This commit is contained in:
committed by
Akshay Joshi
parent
d59816054f
commit
8c3bba65e5
@@ -1891,6 +1891,14 @@ define([
|
||||
pgWindow.default.pgAdmin.Browser.onPreferencesChange('debugger', function() {
|
||||
self.reflectPreferences();
|
||||
});
|
||||
|
||||
/* Register to log the activity */
|
||||
pgBrowser.register_to_activity_listener(document, ()=>{
|
||||
Alertify.alert(gettext('Timeout'), gettext('Your session has timed out due to inactivity. Kindly close the window and login again.'));
|
||||
});
|
||||
|
||||
controller.poll_result = pgBrowser.override_activity_event_decorator(controller.poll_result).bind(controller);
|
||||
controller.poll_end_execution_result = pgBrowser.override_activity_event_decorator(controller.poll_end_execution_result).bind(controller);
|
||||
},
|
||||
reflectPreferences: function() {
|
||||
let self = this,
|
||||
|
||||
Reference in New Issue
Block a user