mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) streamline registration flow for new appsumo users
Summary: This adds a new landing page for cognito sign-up, intended for use by new appsumo users. Their email address is pre-filled and locked down, and sign-up is by entering a password. The page is very crude compared to hosted cognito - especially in error reporting! - but having the address filled in more than makes up for that. The flow does not quite connect with the new billing signup. I think we can do that through the regular "welcome" process, which will list the user's team site. When the user visits that site, we could detect that we are on a site with no domain set yet and for which the user is a billing manager, and trigger a visit to the appropriate billing page. Test Plan: manual - hard to test through cognito email step Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2880
This commit is contained in:
@@ -52,6 +52,11 @@ export function getLoginUrl(nextUrl: string = _getCurrentUrl()): string {
|
||||
return _getLoginLogoutUrl('login', nextUrl);
|
||||
}
|
||||
|
||||
// Get url for the signup page, which will then redirect to nextUrl (current page by default).
|
||||
export function getSignupUrl(nextUrl: string = _getCurrentUrl()): string {
|
||||
return _getLoginLogoutUrl('signup', nextUrl);
|
||||
}
|
||||
|
||||
// Get url for the logout page, which will then redirect to nextUrl (signed-out page by default).
|
||||
export function getLogoutUrl(nextUrl: string = getSignedOutUrl()): string {
|
||||
return _getLoginLogoutUrl('logout', nextUrl);
|
||||
@@ -79,7 +84,7 @@ function _getCurrentUrl(): string {
|
||||
}
|
||||
|
||||
// Helper for getLoginUrl()/getLogoutUrl().
|
||||
function _getLoginLogoutUrl(method: 'login'|'logout'|'signin', nextUrl: string): string {
|
||||
function _getLoginLogoutUrl(method: 'login'|'logout'|'signin'|'signup', nextUrl: string): string {
|
||||
const startUrl = new URL(window.location.href);
|
||||
startUrl.pathname = '/' + method;
|
||||
startUrl.searchParams.set('next', nextUrl);
|
||||
|
||||
Reference in New Issue
Block a user