mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) complete light sign-up flow for appsumo, and customize summaries
Summary: Current appsumo sign-up flow doesn't reach the billing pages. This diff nudges user on through that extra step. It also tweaks plan summaries to say what special appsumo features are in effect (member count prepaid for). Test Plan: manual Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2882
This commit is contained in:
@@ -668,6 +668,24 @@ export class FlexServer implements GristServer {
|
||||
const prefix = isOrgInPathOnly(req.hostname) ? `/o/${mreq.org}` : '';
|
||||
return res.redirect(`${prefix}/welcome/user`);
|
||||
}
|
||||
if (mreq.org && mreq.org.startsWith('o-')) {
|
||||
// We are on a team site without a custom subdomain.
|
||||
// If the user is a billing manager for the org, and the org
|
||||
// is supposed to have a custom subdomain, forward the user
|
||||
// to a page to set it.
|
||||
|
||||
// TODO: this is more or less a hack for AppSumo signup flow,
|
||||
// and could be removed if/when signup flow is revamped.
|
||||
|
||||
// If "welcomeNewUser" is ever added to billing pages, we'd need
|
||||
// to avoid a redirect loop.
|
||||
|
||||
const orgInfo = this.dbManager.unwrapQueryResult(await this.dbManager.getOrg({userId: user.id}, mreq.org));
|
||||
if (orgInfo.billingAccount.isManager && orgInfo.billingAccount.product.features.vanityDomain) {
|
||||
const prefix = isOrgInPathOnly(req.hostname) ? `/o/${mreq.org}` : '';
|
||||
return res.redirect(`${prefix}/billing/payment?billingTask=signUpLite`);
|
||||
}
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user