mirror of
https://github.com/fleetdm/fleet
synced 2026-05-08 09:40:49 +00:00
* Add more specific error for login.js * fix typo, add can I use comment * adjust padding for quote preview * update quoted price when number of hosts change * update footer link layout * fix lint error
44 lines
865 B
JavaScript
Vendored
44 lines
865 B
JavaScript
Vendored
module.exports = {
|
|
|
|
|
|
friendlyName: 'View dashboard',
|
|
|
|
|
|
description: 'Display "Dashboard" page.',
|
|
|
|
|
|
exits: {
|
|
|
|
success: {
|
|
viewTemplatePath: 'pages/customers/dashboard'
|
|
},
|
|
|
|
redirect: {
|
|
description: 'The requesting user does not have a subscription, redirecting to the new license page.',
|
|
responseType: 'redirect',
|
|
},
|
|
|
|
},
|
|
|
|
|
|
fn: async function () {
|
|
|
|
// Get subscription Info
|
|
let thisSubscription = await Subscription.findOne({user: this.req.me.id});
|
|
// If the user does not have a subscription, then help them subscribe.
|
|
if(!thisSubscription) {
|
|
throw {redirect: '/customers/new-license'};
|
|
}
|
|
|
|
|
|
|
|
// Respond with view.
|
|
return {
|
|
stripePublishableKey: sails.config.custom.enableBillingFeatures ? sails.config.custom.stripePublishableKey : undefined,
|
|
thisSubscription,
|
|
};
|
|
|
|
}
|
|
|
|
|
|
};
|