Enterprise-CMCS / macpro-quickstart-serverless

Other
18 stars 14 forks source link

Add idle session timeout #566

Closed ben-harvey closed 1 year ago

ben-harvey commented 2 years ago

Purpose

To follow the CMS Acceptable Risk Safeguards (ARS) controls AC-11 Idle Session Timeout and AC-12(03) Timeout Warning Message, this change adds idle session timeout to the QuickStart sample application. The idle timer detects common user activity (mouse movements, clicks, etc.) and pops up a prompt after a configurable period of inactivity (the 'timeout'). If the user doesn't respond after a second period (the 'prompt timeout'), they are automatically logged out.

https://user-images.githubusercontent.com/25254258/186910249-8b409755-96d5-4c64-be41-2037e4f72744.mov

Linked Issues to Close

N/A

Approach

This change uses the react-idle-timer package to implement an idle timer. I chose this package because it is widely used (~100M downloads) and actively maintained.

The idle timer is defined as a React component, IdleTimer, that is a child of the App component and accepts the following props:

The timeout prop is customizable, but should follow the security requirements for the system. See ISPGBroadcast_AC11.docx for more information.

The prompt modal uses a CMS Design System component for consistent design with the rest of the app.

Learning

Assorted Notes/Considerations

Testing:

Pull Request Creator Checklist

Pull Request Reviewer/Assignee Checklist