diff --git a/website/api/controllers/customers/view-new-license.js b/website/api/controllers/customers/view-new-license.js index 1cc188d242..4eedc5d2a4 100644 --- a/website/api/controllers/customers/view-new-license.js +++ b/website/api/controllers/customers/view-new-license.js @@ -25,7 +25,7 @@ module.exports = { // if the user isn't logged in, we'll redirect them to the register page. if (!this.req.me) { - throw {redirect: '/register?purchaseLicense'}; + throw {redirect: '/register#purchaseLicense'}; } // If the user is a super admin, we'll redirect them to the generate-license page. if(this.req.me.isSuperAdmin) { diff --git a/website/api/controllers/entrance/view-login.js b/website/api/controllers/entrance/view-login.js index 74198f8d7e..0d2beb2fdd 100644 --- a/website/api/controllers/entrance/view-login.js +++ b/website/api/controllers/entrance/view-login.js @@ -7,12 +7,7 @@ module.exports = { description: 'Display "Login" page.', inputs: { - purchaseLicense: { - type: 'boolean', - description: 'If this query string is provided, this user will be taken directly to the /new-license page after they login.', - extendedDescription: 'This value is only present when a user navigates to this page from the /register page if they were redirected to that page from the /new-license page.', - defaultsTo: false, - } + }, exits: { @@ -29,7 +24,7 @@ module.exports = { }, - fn: async function ({purchaseLicense}) { + fn: async function () { if (this.req.me) { if(this.req.me.isSuperAdmin){ @@ -39,9 +34,7 @@ module.exports = { } } - return { - redirectToLicenseDispenser: purchaseLicense, - }; + return; } diff --git a/website/api/controllers/entrance/view-signup.js b/website/api/controllers/entrance/view-signup.js index 140ffc98cd..2c5fe4a5f3 100644 --- a/website/api/controllers/entrance/view-signup.js +++ b/website/api/controllers/entrance/view-signup.js @@ -6,14 +6,7 @@ module.exports = { description: 'Display "Signup" page.', - inputs: { - purchaseLicense: { - type: 'boolean', - description: 'If this query string is provided, this user will be taken directly to the /new-license page after they signup.', - extendedDescription: 'This value will only be present if the user is redirected to this page from the customers/view-new-license', - defaultsTo: false, - } - }, + inputs: {}, exits: { @@ -29,15 +22,13 @@ module.exports = { }, - fn: async function ({purchaseLicense}) { + fn: async function () { if (this.req.me) { throw {redirect: '/start'}; } - return { - redirectToLicenseDispenser: purchaseLicense, - }; + return; } diff --git a/website/api/helpers/salesforce/create-lead.js b/website/api/helpers/salesforce/create-lead.js index cd55ffb76e..7f7e28bd04 100644 --- a/website/api/helpers/salesforce/create-lead.js +++ b/website/api/helpers/salesforce/create-lead.js @@ -62,7 +62,7 @@ module.exports = { return await salesforceConnection.sobject('Contact') .retrieve(salesforceContactId); }).intercept((err)=>{ - return new Error(`When attempting to create a new Lead record using an existing Contact record (ID: ${salesforceContactId}), an error occurred when retreiving the specified record. Full error: ${err}`); + return new Error(`When attempting to create a new Lead record using an existing Contact record (ID: ${salesforceContactId}), an error occurred when retreiving the specified record. Error: ${err}`); }); // Get the Account record. @@ -70,7 +70,7 @@ module.exports = { return await salesforceConnection.sobject('Account') .retrieve(salesforceAccountId); }).intercept((err)=>{ - return new Error(`When attempting to create a Lead record using an exisitng Account record (ID: ${salesforceAccountId}), An error occured when retreiving the specified record. Full error: ${err}`); + return new Error(`When attempting to create a Lead record using an exisitng Account record (ID: ${salesforceAccountId}), An error occured when retreiving the specified record. Error: ${err}`); }); let primaryBuyingSituationValuesByCodename = { @@ -106,7 +106,7 @@ module.exports = { OwnerId: accountRecord.OwnerId }); }).intercept((err)=>{ - return new Error(`Could not create new Lead record. Full error: ${err}`); + return new Error(`Could not create new Lead record. Error: ${err}`); }); } diff --git a/website/assets/js/pages/entrance/login.page.js b/website/assets/js/pages/entrance/login.page.js index 4e278eeeab..a73ca3fc79 100644 --- a/website/assets/js/pages/entrance/login.page.js +++ b/website/assets/js/pages/entrance/login.page.js @@ -37,10 +37,12 @@ parasails.registerPage('login', { if(window.location.search === '?admin') { this.showCustomerLogin = false; } + // If we're redirecting this user to the license dispenser after they log in, modify the link to the /register page and the pageToRedirectToAfterLogin. - if(this.redirectToLicenseDispenser){ - this.loginSlug = '/register?purchaseLicense'; + if(window.location.hash && window.location.hash === '#purchaseLicense'){ + this.registerSlug = '/register#purchaseLicense'; this.pageToRedirectToAfterLogin = '/new-license'; + window.location.hash = ''; } }, mounted: async function() { diff --git a/website/assets/js/pages/entrance/signup.page.js b/website/assets/js/pages/entrance/signup.page.js index 8521e3bb8d..0680b39b98 100644 --- a/website/assets/js/pages/entrance/signup.page.js +++ b/website/assets/js/pages/entrance/signup.page.js @@ -34,9 +34,10 @@ parasails.registerPage('signup', { // ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝ beforeMount: function() { // If we're redirecting this user to the license dispenser after they sign up, modify the link to the login page and the pageToRedirectToAfterRegistration - if(this.redirectToLicenseDispenser){ - this.loginSlug = '/login?purchaseLicense'; + if(window.location.hash && window.location.hash === '#purchaseLicense'){ + this.loginSlug = '/login#purchaseLicense'; this.pageToRedirectToAfterRegistration = '/new-license'; + window.location.hash = ''; } }, mounted: async function() {