user-story
user-story copied to clipboard
Fix #59: Added timeout tracker to check session expiration
Issue Number
fixes #59
Describe the changes you've made
I have added a timeout tracker which periodically checks if the session has expired or not. The session limit is set to 1 hour
by default. In order to change the limit, we can add a sessionLimit
field in the src/config.json
, and provide the number of seconds as its value.
For example, if we want the session to be of 20 seconds
, as shown in the demo below, the file should be
{
"apiURL": "<url>",
"APP_ENV": "dev",
"sessionLimit": 20
}
The basic flow is -
- User logs into the application
- The
expirationTime
is saved into in local storage - A timeout tracker is started to check if the session had expired periodically
- When the session expires, the user is logged out automatically
Describe if there is any unusual behavior (Any Warning) of your code(Write NA
if there isn't)
NA
Additional context (OPTIONAL)
NA
Test plan (OPTIONAL)
NA
Checklist
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] All new and existing tests passed.
- [x] The title of my pull request is a short description of the requested changes.
Provide a Deployed link of route/page that needs to review
https://user-images.githubusercontent.com/75155230/155506974-35c4d082-5eeb-4512-9787-0ba29d0c3a08.mp4