mirror of
https://github.com/fleetdm/fleet
synced 2026-05-02 19:07:38 +00:00
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
45 lines
787 B
JavaScript
45 lines
787 B
JavaScript
module.exports = {
|
|
|
|
|
|
friendlyName: 'Broadcast session change',
|
|
|
|
|
|
description: 'Broadcast a socket notification indicating a change in login status.',
|
|
|
|
|
|
inputs: {
|
|
|
|
req: {
|
|
type: 'ref',
|
|
required: true,
|
|
},
|
|
|
|
},
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
description: 'All done.',
|
|
},
|
|
|
|
},
|
|
|
|
|
|
fn: async function ({ req }) {
|
|
|
|
// If there's no sessionID, we don't need to broadcase a message about the old session.
|
|
if(!req.sessionID) {
|
|
return;
|
|
}
|
|
|
|
let roomName = `session${_.deburr(req.sessionID)}`;
|
|
let messageText = `You have signed out or signed into a different session in another tab or window. Reload the page to refresh your session.`;
|
|
sails.sockets.broadcast(roomName, 'session', { notificationText: messageText }, req);
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|