fleet/website/api/controllers/try-fleet/view-register.js
Eric 4a6bf0d447
2023-10-24 Website: Update /try-fleet (#14638)
Closes: https://github.com/fleetdm/confidential/issues/4015

Changes:
- Changed the url for `/fleetctl-preview` to
`/try-fleet/fleetctl-preview`
- Updated the controller for the `/fleetctl-preview` page to redirect
non-logged-in users to `/try-fleet/login`
- Removed the route for `/try-fleet/sandbox-expired`, and added a
redirect going to `/try-fleet/fleetctl-preview`.
- Updated the controller for `/try-fleet/sandbox` to redirect the users
without a non-expired Sandbox instance to `/try-fleet/fleetctl-preview`.
- Updated `signup.js` to not provision Fleet sandbox instances for
users.
- Updated the `User` model to support a third `signupReason`: "Try
Fleet"
- Updated `/try-fleet/register` to submit "Try Fleet" as a
`signupReason` when users sign up.
- Renamed the files for the `/fleetctl-preview` page (`get-started` »
`fleetctl-preview`)
- Updated/removed Fleet Sandbox related handbook sections.
- Replaced the "Fleet vs Fleet Sandbox" section in the deploying
documentation with a note about `fleetctl preview`.
- Updated links to Fleet Sandbox in articles.

---------

Co-authored-by: Mike Thomas <[email protected]>
2023-10-20 13:59:18 -05:00

38 lines
705 B
JavaScript
Vendored

module.exports = {
friendlyName: 'View register',
description: 'Display "Register" page. Note: This page is the "signup" page skinned for Fleet Sandbox.',
exits: {
success: {
viewTemplatePath: 'pages/try-fleet/register'
},
redirect: {
description: 'The requesting user is already logged in.',
responseType: 'redirect'
}
},
fn: async function () {
// If the user is logged in, redirect them to the Fleet sandbox page.
// FUTURE: once all Sandbox instances have expired, redirect users to the fleetctl-preview page.
if (this.req.me) {
throw {redirect: '/try-fleet/sandbox'};
}
// Respond with view.
return {};
}
};