fleet/ee/vulnerability-dashboard/api/controllers/observe-my-session.js
Eric b1945b2128
Add fleet-vulnerability-dashboard repo to ee/ folder (#17428)
Closes: https://github.com/fleetdm/confidential/issues/4057

Changes:
- Added the contents of the fleet-vulnerability-dashboard repo to
ee/vulnerability-dashboard
- Added a github workflow to deploy the vulnerability dashboard on
Heroku
- Added a github workflow to test changes to the vulnerability-dashboard
- Updated the website's custom configuration to enable
auto-approvals/review requests to files in the
ee/vulnerability-dashboard folder
2024-03-13 13:06:11 -05:00

32 lines
671 B
JavaScript

module.exports = {
friendlyName: 'Observe my session',
description: 'Subscribe to the logged-in user\'s session so that you receive socket broadcasts when logged out in another tab.',
exits: {
success: {
description: 'The requesting socket is now subscribed to socket broadcasts about the logged-in user\'s session.',
},
},
fn: async function ({}) {
if (!this.req.isSocket) {
throw new Error('This action is designed for use with the virtual request interpreter (over sockets, not traditional HTTP).');
}
let roomName = `session${_.deburr(this.req.sessionID)}`;
sails.sockets.join(this.req, roomName);
}
};