mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
Related to: #20296 Changes: - Added `ee/bulk-operations-dashboard`, a Sails.js app that lets users manage configuration profiles and scripts across multiple teams on a Fleet instance. - Added a Github workflow to deploy the app to Heroku - Added a Github workflow to test changes to the bulk operations dashboard.
37 lines
821 B
JavaScript
37 lines
821 B
JavaScript
/**
|
|
* expired.js
|
|
*
|
|
* A custom response that content-negotiates the current request to either:
|
|
* • serve an HTML error page about the specified token being invalid or expired
|
|
* • or send back 498 (Token Expired/Invalid) with no response body.
|
|
*
|
|
* Example usage:
|
|
* ```
|
|
* return res.expired();
|
|
* ```
|
|
*
|
|
* Or with actions2:
|
|
* ```
|
|
* exits: {
|
|
* badToken: {
|
|
* description: 'Provided token was expired, invalid, or already used up.',
|
|
* responseType: 'expired'
|
|
* }
|
|
* }
|
|
* ```
|
|
*/
|
|
module.exports = function expired() {
|
|
|
|
var req = this.req;
|
|
var res = this.res;
|
|
|
|
sails.log.verbose('Ran custom response: res.expired()');
|
|
|
|
if (req.wantsJSON) {
|
|
return res.status(498).send('Token Expired/Invalid');
|
|
}
|
|
else {
|
|
return res.status(498).view('498');
|
|
}
|
|
|
|
};
|