FlowFuse / FlowFuse/node-red-dashboard-2-user-addon
Architecture Proposal for User Session Data
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Description
1. Addition to Dashboard code `onAction` and `onChange` to include `msg.socketid` on _all_ transmitted messages
2. Dashboard does HTTP call on load to Node-RED as per https://flowfuse.com/blog/2023/11/dashboard-2.0-user-tracking/
- This can include `` which would include the relevant SocketID _and_ the session data for that user, provided by Node-RED Auth Middleware
3. Back in `ui-base`, we watch for the relevant `/tracker` (or eqv.) HTTP call, and then map `socketid` to `req.session.user`
4. All `onAction`, `onChange`, etc. events can then recall from this map, and attach the user object
5. On Socket Disconnect, remove the relevant entry from the map
### Epic/Story
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.