feat: Add configurable auto logout on inactivity
Users can pick an inactivity timeout in their preferences. A warning appears 30 seconds before, and activity or a logout is synchronised across open tabs.
This commit is contained in:
@@ -26,6 +26,7 @@ const initialState = {
|
||||
projectsSearch: '',
|
||||
projectsOrder: ProjectOrders.BY_DEFAULT,
|
||||
isHiddenProjectsVisible: false, // TODO: refactor?
|
||||
autoLogoutWarning: null,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line default-param-last
|
||||
@@ -117,6 +118,18 @@ export default (state = initialState, { type, payload }) => {
|
||||
...state,
|
||||
isLogouting: true,
|
||||
};
|
||||
case ActionTypes.AUTO_LOGOUT_WARNING_SHOW:
|
||||
return {
|
||||
...state,
|
||||
autoLogoutWarning: {
|
||||
expiresAt: payload.expiresAt,
|
||||
},
|
||||
};
|
||||
case ActionTypes.AUTO_LOGOUT_WARNING_DISMISS:
|
||||
return {
|
||||
...state,
|
||||
autoLogoutWarning: null,
|
||||
};
|
||||
case ActionTypes.MODAL_OPEN:
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user