hackforla / hackforla/tdm-calculator
Bug: Edit FAQ Screen Remains in Editable State After Automatic Logout of Admin
- Dominant language
- JavaScript
- Stars
- 68
- Forks
- 47
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 25
Description
### Overview
When an administrator is automatically logged out due to inactivity while on the Edit FAQ page, the interface continues to display editable fields and FAQ reordering controls (i.e., you can create a new FAQ, Category, or edit an existing FAQ or Category). Although you can edit, you cannot save.
#### Actual
- When the admin is logged out while in the editing state due to inactivity, the UI still allows the ablility to edit the text and reorder FAQs.
- The processs of inactivity logging out takes away the "Save Edits" button on the FAQ page.
Screenshot of clicking edit, then being logged out for inactivity
- When the admin tryies to navigate away from the page they are prompted with the modal that warns them they will be loosing their edits and offers the option to PROCEED or Cancel
Details
#### Expected
When the admin is logged out while in the editing state due to inactivity, the UI should immediately transition to the standard logged-out state when the session expires, ensuring that it accurately reflects the user's authentication status and permissions and pop a modal that tells them
```
You have been logged out due to inactivity and any changes you made are not saved.
OK
```
### Action Items
- [ ] Assign yourself to the development issue.
- [ ] Move the development issue from the Prioritized Backlog to In Progress.
- [ ] Make code changes to implement the described feature.
- [ ] Review with product and dev. Update if needed based on feedback
- [ ] Once finalized, add before and after images to the slide in the staging deck for this issue (see link under resources)
- [ ] Get Stakeholder sign-off via the stakeholder meeting slide deck.
### Tech-Notes:
- You can shorted the jwt settion in `server/middleware/jwt-session.js` so the automatic logout occurs faster.
- https://github.com/hackforla/tdm-calculator/blob/develop/server/middleware/jwt-session.js#L23
- change `43200000` to something shorter (ie: 15000)
### Resources/Instructions
Screenshot of logged out view of FAQ
Screenshot of admin logged in view of FAQ
#### Staging and Release decks
- [Staging Deck](https://docs.google.com/presentation/d/1crZ3IxqA4hAu3qzD7ns93Ieuqjwh6wyEtuX_46cP-fg/)
- [Staging slide, 3293](https://docs.google.com/presentation/d/1crZ3IxqA4hAu3qzD7ns93Ieuqjwh6wyEtuX_46cP-fg/edit?slide=id.g3eb8ff4ade6_15_20#slide=id.g3eb8ff4ade6_15_20)
- Release Deck
- [2025-MM-DD Release deck, slide ISSUE NUMBER]
Contributor guide
Research direction
Read the FAQ editing flow and server/middleware/jwt-session.js, especially the session timeout referenced in the issue. Temporarily shorten 43200000 to 15000 to reproduce automatic logout while editing. Done means the FAQ screen immediately shows the logged-out state and displays the specified inactivity warning without leaving editable controls or unsaved-edits navigation prompts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- authentication, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100