From 9abb521099fc1b12e62f5ae053f58b6249bff564 Mon Sep 17 00:00:00 2001 From: Carlos Mostek Date: Mon, 12 Aug 2024 17:59:25 -0500 Subject: [PATCH 01/10] Add argument for bootstrap and warning for running it with localhost instead --- scripts/bootstrap.mjs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 45c115930..19df4b687 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -3,12 +3,20 @@ import { readFile, writeFile } from "node:fs/promises" import { $ } from "execa" import ora from "ora" -const APP_BASE_URL = "http://localhost:3000" +const APP_BASE_URL = process.argv[2] || "http://localhost:3000" const MANAGEMENT_CLIENT_NAME = "SaaStart Management" const DASHBOARD_CLIENT_NAME = "SaaStart Dashboard" const DEFAULT_CONNECTION_NAME = "SaaStart-Shared-Database" const CUSTOM_CLAIMS_NAMESPACE = "https://example.com" +const isLocalHost = APP_BASE_URL.startsWith('http://localhost') +const isLocalHostOk = process.argv[2] === "allowLocalhost"; + +if (isLocalHost && !isLocalHostOk) { + console.warn(`ERROR: invite links won't work when using ${APP_BASE_URL} as your application base URL. Checkout the README-ADVANCED.md for instructions on how to use https. To override this and run anyway, re-run using: npm run auth0:bootstrap -- allowLocalhost`) + process.exit(-2); +} + // checks if (process.version.replace("v", "").split(".")[0] < 20) { @@ -186,7 +194,7 @@ try { "description": "The client to facilitate login to the dashboard in the context of an organization.", "callbacks": [`${APP_BASE_URL}/api/auth/callback`], "allowed_logout_urls": [APP_BASE_URL], - "initiate_login_uri": "https://example.com/api/auth/login", + "initiate_login_uri": `${ isLocalHost ? 'https://example.com' : APP_BASE_URL }/api/auth/login`, "app_type": "regular_web", "oidc_conformant": true, "grant_types": ["authorization_code","refresh_token"], From 53d37335f14290f81bf864c829b78cc1111a8d8b Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Thu, 15 Aug 2024 15:43:42 -0300 Subject: [PATCH 02/10] Experiment with prompt in bootstrap script --- package-lock.json | 2 +- scripts/bootstrap.mjs | 161 ++++++++++++++++++++++++------------------ 2 files changed, 93 insertions(+), 70 deletions(-) diff --git a/package-lock.json b/package-lock.json index 638b6a566..a4d6ed5c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "cmdk": "^1.0.0", "execa": "^9.1.0", "lucide-react": "^0.379.0", - "next": "^14.2.5", + "next": "^14.2.3", "next-themes": "^0.3.0", "ora": "^8.0.1", "react": "^18.3.1", diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 19df4b687..2b8d30e85 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -1,81 +1,96 @@ +import { $ } from "execa" import { randomBytes } from "node:crypto" import { readFile, writeFile } from "node:fs/promises" -import { $ } from "execa" import ora from "ora" +import readline from 'node:readline/promises'; + +const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout +}); + +async function main() { + try { + // Prompt user for APP_BASE_URL + let APP_BASE_URL = await rl.question('Enter your application base URL (leave blank to use default: http://localhost:3000): '); + APP_BASE_URL = APP_BASE_URL.trim() || 'http://localhost:3000'; + + const isLocalHost = APP_BASE_URL.startsWith('http://localhost'); + + if (isLocalHost) { + const confirmLocalhost = await rl.question('Using localhost may cause invite links to not work. Do you want to continue? (y/n): '); + if (confirmLocalhost.toLowerCase() !== 'y') { + console.log('Exiting. Please check README-ADVANCED.md for instructions on how to use https.'); + return; + } + } -const APP_BASE_URL = process.argv[2] || "http://localhost:3000" -const MANAGEMENT_CLIENT_NAME = "SaaStart Management" -const DASHBOARD_CLIENT_NAME = "SaaStart Dashboard" -const DEFAULT_CONNECTION_NAME = "SaaStart-Shared-Database" -const CUSTOM_CLAIMS_NAMESPACE = "https://example.com" - -const isLocalHost = APP_BASE_URL.startsWith('http://localhost') -const isLocalHostOk = process.argv[2] === "allowLocalhost"; - -if (isLocalHost && !isLocalHostOk) { - console.warn(`ERROR: invite links won't work when using ${APP_BASE_URL} as your application base URL. Checkout the README-ADVANCED.md for instructions on how to use https. To override this and run anyway, re-run using: npm run auth0:bootstrap -- allowLocalhost`) - process.exit(-2); -} - -// checks - -if (process.version.replace("v", "").split(".")[0] < 20) { - console.error("Node.js version 20 or later is required to run this script.") - process.exit(1) -} - -const cliCheck = ora({ - text: `Checking that the Auth0 CLI has been installed`, -}).start() -try { - await $`auth0 --version` - cliCheck.succeed() -} catch (e) { - cliCheck.fail( - "The Auth0 CLI must be installed: https://github.com/auth0/auth0-cli" - ) - process.exit(1) -} - -// NOTE: we're outputting as CSV here due to a bug in the Auth0 CLI that doesn't respect the --json flag -// https://github.com/auth0/auth0-cli/pull/1002 -const tenantSettingsArgs = ["tenants", "list", "--csv"] + console.log(`Using APP_BASE_URL: ${APP_BASE_URL}`); -const { stdout } = await $`auth0 ${tenantSettingsArgs}` + const MANAGEMENT_CLIENT_NAME = "SaaStart Management" + const DASHBOARD_CLIENT_NAME = "SaaStart Dashboard" + const DEFAULT_CONNECTION_NAME = "SaaStart-Shared-Database" + const CUSTOM_CLAIMS_NAMESPACE = "https://example.com" -// parse the CSV to get the current active tenant (skip the first line) -// and get the one that starts with the "→" symbol -const AUTH0_DOMAIN = stdout - .split("\n") - .slice(1) - .find((line) => line.includes("→")) - .split(",")[1] - .trim() + // checks -// tenant settings + if (process.version.replace("v", "").split(".")[0] < 20) { + console.error("Node.js version 20 or later is required to run this script.") + return; + } -const tenantSettings = ora({ - text: `Initialize tenant settings`, -}).start() -try { - // prettier-ignore - const tenantSettingsArgs = [ - "api", "patch", "tenants/settings", - "--data", JSON.stringify({ - "customize_mfa_in_postlogin_action": true, - "flags": { "enable_client_connections": false }, - "friendly_name": "SaaStart", - "picture_url": "https://cdn.auth0.com/blog/auth0_by_okta_logo_black.png", - }), - ]; + const cliCheck = ora({ + text: `Checking that the Auth0 CLI has been installed`, + }).start() + try { + await $`auth0 --version` + cliCheck.succeed() + } catch (e) { + cliCheck.fail( + "The Auth0 CLI must be installed: https://github.com/auth0/auth0-cli" + ) + return; + } - await $`auth0 ${tenantSettingsArgs}` - tenantSettings.succeed() -} catch (e) { - tenantSettings.fail(`Failed to initialize tenant settings`) - console.log(e) - process.exit(1) -} + // NOTE: we're outputting as CSV here due to a bug in the Auth0 CLI that doesn't respect the --json flag + // https://github.com/auth0/auth0-cli/pull/1002 + const tenantSettingsArgs = ["tenants", "list", "--csv"] + + const { stdout } = await $`auth0 ${tenantSettingsArgs}` + + // parse the CSV to get the current active tenant (skip the first line) + // and get the one that starts with the "→" symbol + const AUTH0_DOMAIN = stdout + .split("\n") + .slice(1) + .find((line) => line.includes("→")) + .split(",")[1] + .trim() + + // tenant settings + + const tenantSettings = ora({ + text: `Initialize tenant settings`, + }).start() + try { + // prettier-ignore + const tenantSettingsArgs = [ + "api", "patch", "tenants/settings", + "--data", JSON.stringify({ + "customize_mfa_in_postlogin_action": true, + "flags": { "enable_client_connections": false }, + "friendly_name": "SaaStart", + "picture_url": "https://cdn.auth0.com/blog/auth0_by_okta_logo_black.png", + }), + ]; + + await $`auth0 ${tenantSettingsArgs}` + tenantSettings.succeed() + } catch (e) { + tenantSettings.fail(`Failed to initialize tenant settings`) + console.log(e) + return; + } // prompt settings @@ -600,3 +615,11 @@ async function waitUntilActionIsBuilt(actionId) { await new Promise((resolve) => setTimeout(resolve, 1500)) } } + + + } finally { + rl.close(); + } +} + +main().catch(console.error); \ No newline at end of file From fce8977160dd444091210eff2afb5e817376be3f Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Thu, 15 Aug 2024 15:50:59 -0300 Subject: [PATCH 03/10] Formatting update --- scripts/bootstrap.mjs | 49 ++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 2b8d30e85..e2e7940e0 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -1,6 +1,6 @@ -import { $ } from "execa" import { randomBytes } from "node:crypto" import { readFile, writeFile } from "node:fs/promises" +import { $ } from "execa" import ora from "ora" import readline from 'node:readline/promises'; @@ -13,14 +13,17 @@ async function main() { try { // Prompt user for APP_BASE_URL let APP_BASE_URL = await rl.question('Enter your application base URL (leave blank to use default: http://localhost:3000): '); + APP_BASE_URL = APP_BASE_URL.trim() || 'http://localhost:3000'; const isLocalHost = APP_BASE_URL.startsWith('http://localhost'); if (isLocalHost) { const confirmLocalhost = await rl.question('Using localhost may cause invite links to not work. Do you want to continue? (y/n): '); + if (confirmLocalhost.toLowerCase() !== 'y') { console.log('Exiting. Please check README-ADVANCED.md for instructions on how to use https.'); + return; } } @@ -119,7 +122,9 @@ try { const createManagementClient = ora({ text: `Creating ${MANAGEMENT_CLIENT_NAME} client`, }).start() -let managementClient + +let managementClient; + try { // prettier-ignore const createClientArgs = [ @@ -198,8 +203,10 @@ try { const createDashboardClient = ora({ text: `Creating ${DASHBOARD_CLIENT_NAME} client`, -}).start() -let dashboardClient +}).start(); + +let dashboardClient; + try { // prettier-ignore const createClientArgs = [ @@ -238,8 +245,10 @@ try { const createDatabaseConnection = ora({ text: `Creating ${DEFAULT_CONNECTION_NAME} connection`, -}).start() -let defaultConnection +}).start(); + +let defaultConnection; + try { // prettier-ignore const createConnectionArgs = [ @@ -267,8 +276,10 @@ try { const createAdminRole = ora({ text: `Creating admin role`, -}).start() -let adminRole +}).start(); + +let adminRole; + try { // prettier-ignore const createRoleArgs = [ @@ -289,8 +300,10 @@ try { const createMemberRole = ora({ text: `Creating member role`, -}).start() -let memberRole +}).start(); + +let memberRole; + try { // prettier-ignore const createRoleArgs = [ @@ -314,7 +327,9 @@ try { const createSecurityPoliesAction = ora({ text: `Creating Security Policies Action`, }).start() -let securityPoliciesAction + +let securityPoliciesAction; + try { const code = await readFile("./actions/security-policies.js", { encoding: "utf-8", @@ -354,7 +369,9 @@ try { const createAddDefaultRoleAction = ora({ text: `Creating Add Default Role Action`, }).start() -let addDefaultRoleAction + +let addDefaultRoleAction; + try { const code = await readFile("./actions/add-default-role.js", { encoding: "utf-8", @@ -397,7 +414,9 @@ try { const createAddRoleToTokensAction = ora({ text: `Creating Add Role to Tokens Action`, }).start() -let addRoleToTokensAction + +let addRoleToTokensAction; + try { const code = await readFile("./actions/add-role-to-tokens.js", { encoding: "utf-8", @@ -588,6 +607,7 @@ try { const enableOtp = ora({ text: `Enabling OTP MFA factor`, }).start() + try { // prettier-ignore const enableOtpArgs = [ @@ -616,10 +636,9 @@ async function waitUntilActionIsBuilt(actionId) { } } - } finally { rl.close(); } } -main().catch(console.error); \ No newline at end of file +main().catch(console.error); From d190641a389c5ae2e75de553d83494d82af42e66 Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Thu, 15 Aug 2024 15:57:39 -0300 Subject: [PATCH 04/10] Adjust prompt language to be more friendly --- scripts/bootstrap.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index e2e7940e0..0b3d8ce40 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -19,10 +19,10 @@ async function main() { const isLocalHost = APP_BASE_URL.startsWith('http://localhost'); if (isLocalHost) { - const confirmLocalhost = await rl.question('Using localhost may cause invite links to not work. Do you want to continue? (y/n): '); + const confirmLocalhost = await rl.question('Using localhost is fine for local development and experimentation, but you might discover invite links do not work due to the lack of https. Do you want to continue? (y/n): '); if (confirmLocalhost.toLowerCase() !== 'y') { - console.log('Exiting. Please check README-ADVANCED.md for instructions on how to use https.'); + console.log('Exiting. If you want to learn how to set up https, please check the README-ADVANCED.md for instructions.'); return; } From 010182f5a026320948cb375e20b2073ac44bab2f Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Fri, 16 Aug 2024 09:44:18 -0300 Subject: [PATCH 05/10] Add clarity with bootstrap introduction text --- scripts/bootstrap.mjs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 0b3d8ce40..68ab23533 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -11,18 +11,28 @@ const rl = readline.createInterface({ async function main() { try { + console.log("============================================="); + console.log("Auth0 B2B SaaS Starter - Bootstrapping Script"); + console.log("=============================================\n"); + console.log("This script configures your Auth0 tenant for use with SaaStart. Only run"); + console.log("this command on a newly created tenant to ensure a clean start. To learn"); + console.log("more check the README.md file or inspect the /script/bootstrap.mjs file.\n"); + // Prompt user for APP_BASE_URL - let APP_BASE_URL = await rl.question('Enter your application base URL (leave blank to use default: http://localhost:3000): '); + let APP_BASE_URL = await rl.question('Enter your application base URL (leave blank for default: http://localhost:3000): '); APP_BASE_URL = APP_BASE_URL.trim() || 'http://localhost:3000'; const isLocalHost = APP_BASE_URL.startsWith('http://localhost'); if (isLocalHost) { - const confirmLocalhost = await rl.question('Using localhost is fine for local development and experimentation, but you might discover invite links do not work due to the lack of https. Do you want to continue? (y/n): '); + console.log("\nUsing localhost is fine for local development and experimentation, but"); + console.log("using a non-https:// URL has limitations and some features (for example"); + console.log("invite links for organizations) will not work."); + const confirmLocalhost = await rl.question('\nDo you want to continue without https://? (y/N): '); if (confirmLocalhost.toLowerCase() !== 'y') { - console.log('Exiting. If you want to learn how to set up https, please check the README-ADVANCED.md for instructions.'); + console.log('\nExiting. If you want to learn how to set up https://, read README-ADVANCED.md for instructions.'); return; } From c66c5f6868693050fe7993d39c5046e9e96ed05a Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Fri, 16 Aug 2024 10:32:31 -0300 Subject: [PATCH 06/10] Better formatting in bootstrap script message --- scripts/bootstrap.mjs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 68ab23533..370c91383 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -11,15 +11,18 @@ const rl = readline.createInterface({ async function main() { try { - console.log("============================================="); - console.log("Auth0 B2B SaaS Starter - Bootstrapping Script"); - console.log("=============================================\n"); - console.log("This script configures your Auth0 tenant for use with SaaStart. Only run"); - console.log("this command on a newly created tenant to ensure a clean start. To learn"); - console.log("more check the README.md file or inspect the /script/bootstrap.mjs file.\n"); + console.log(`================================================================================ +Auth0 B2B SaaS Starter Bootstrap Script +================================================================================ + +This script configures your Auth0 tenant for use with SaaStart. Only run +this command on a newly created tenant to ensure a clean start. To learn +more check the README.md file or inspect the /script/bootstrap.mjs file. + +Enter your application base URL (leave blank for default: http://localhost:3000):`); // Prompt user for APP_BASE_URL - let APP_BASE_URL = await rl.question('Enter your application base URL (leave blank for default: http://localhost:3000): '); + let APP_BASE_URL = await rl.question(''); APP_BASE_URL = APP_BASE_URL.trim() || 'http://localhost:3000'; @@ -38,7 +41,7 @@ async function main() { } } - console.log(`Using APP_BASE_URL: ${APP_BASE_URL}`); + console.log(`\nUsing APP_BASE_URL: ${APP_BASE_URL}`); const MANAGEMENT_CLIENT_NAME = "SaaStart Management" const DASHBOARD_CLIENT_NAME = "SaaStart Dashboard" From 79290a2458c56ce04de27f0d534e0357a4fde513 Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Fri, 16 Aug 2024 11:46:30 -0300 Subject: [PATCH 07/10] Add capability to skip prompt with -- allowLocalhost flag --- README.md | 13 +++++++++---- scripts/bootstrap.mjs | 29 +++++++++++++++++++---------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index fb6b087f4..87b7b9a7c 100644 --- a/README.md +++ b/README.md @@ -111,10 +111,7 @@ This step will create and update entities in your Auth0 tenant. The provided scr - Creating email and login templates - Enabling MFA factors -Finally, it will save environment variables for your tenant in the application directory. - -> **Warning** -> +> [!WARNING] > Only run the following command on a newly created tenant to avoid changing existing configuration or introducing conflicting elements to your existing Auth0 tenants! > > If you are creating a new Auth0 tenant at this point in the process, go back to step 2 in order to ensure you're logged into the correct Auth0 tenant. @@ -125,6 +122,14 @@ Run the following command: npm run auth0:bootstrap ``` +The script will prompt you to provide an **application base URL**, which defaults to http://localhost:3000. If you're configuring the application to run with HTTPS or on a production URL, this is your opportunity to set it. Learn more about this in [README-ADVANCED.md](README-ADVANCED.md). + +> [!TIP] +> If you want to skip this prompt you can run the bootstrapping command with an arguement: +> ```bash +> npm run auth0:bootstrap -- allowLocalhost +> ``` + Once the script has successfully completed, a `.env.local` file containing the environment variables will be written to the root of your project directory. ### Step Four: Run the sample application diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 370c91383..27a43d9b8 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -10,6 +10,8 @@ const rl = readline.createInterface({ }); async function main() { + const skipPrompts = process.argv.includes('allowLocalhost'); + try { console.log(`================================================================================ Auth0 B2B SaaS Starter Bootstrap Script @@ -18,30 +20,37 @@ Auth0 B2B SaaS Starter Bootstrap Script This script configures your Auth0 tenant for use with SaaStart. Only run this command on a newly created tenant to ensure a clean start. To learn more check the README.md file or inspect the /script/bootstrap.mjs file. - -Enter your application base URL (leave blank for default: http://localhost:3000):`); +`); - // Prompt user for APP_BASE_URL - let APP_BASE_URL = await rl.question(''); + let APP_BASE_URL; - APP_BASE_URL = APP_BASE_URL.trim() || 'http://localhost:3000'; + if (skipPrompts) { + APP_BASE_URL = 'http://localhost:3000'; + } else { + console.log(`Enter your application base URL (leave blank for default: http://localhost:3000):`); + + // Prompt user for APP_BASE_URL + APP_BASE_URL = await rl.question(''); + } - const isLocalHost = APP_BASE_URL.startsWith('http://localhost'); + const isLocalHost = APP_BASE_URL.startsWith('http://localhost') || APP_BASE_URL === ""; - if (isLocalHost) { + if (isLocalHost && skipPrompts === false) { console.log("\nUsing localhost is fine for local development and experimentation, but"); console.log("using a non-https:// URL has limitations and some features (for example"); console.log("invite links for organizations) will not work."); - const confirmLocalhost = await rl.question('\nDo you want to continue without https://? (y/N): '); + + const confirmLocalhost = await rl.question('\nDo you want to continue without https://? (y/N):\n'); if (confirmLocalhost.toLowerCase() !== 'y') { - console.log('\nExiting. If you want to learn how to set up https://, read README-ADVANCED.md for instructions.'); + console.log(`\nExiting. If you want to learn how to set up https://, read README-ADVANCED.md for +instructions.`); return; } } - console.log(`\nUsing APP_BASE_URL: ${APP_BASE_URL}`); + console.log(`Using APP_BASE_URL: ${APP_BASE_URL}`); const MANAGEMENT_CLIENT_NAME = "SaaStart Management" const DASHBOARD_CLIENT_NAME = "SaaStart Dashboard" From 5e6ffb78731705b9ac8f8a2dac22f6b9c57fa3b4 Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Fri, 16 Aug 2024 15:37:57 -0300 Subject: [PATCH 08/10] Typo in Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87b7b9a7c..5e6ef83ff 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ npm run auth0:bootstrap The script will prompt you to provide an **application base URL**, which defaults to http://localhost:3000. If you're configuring the application to run with HTTPS or on a production URL, this is your opportunity to set it. Learn more about this in [README-ADVANCED.md](README-ADVANCED.md). > [!TIP] -> If you want to skip this prompt you can run the bootstrapping command with an arguement: +> If you want to skip this prompt you can run the bootstrapping command with an argument: > ```bash > npm run auth0:bootstrap -- allowLocalhost > ``` From 1a9b5464ec6229850ee6a0bd00b03eff2173394d Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Tue, 20 Aug 2024 15:35:56 -0300 Subject: [PATCH 09/10] Refine prompt language --- scripts/bootstrap.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index 27a43d9b8..69b1dc052 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -40,11 +40,12 @@ more check the README.md file or inspect the /script/bootstrap.mjs file. console.log("using a non-https:// URL has limitations and some features (for example"); console.log("invite links for organizations) will not work."); - const confirmLocalhost = await rl.question('\nDo you want to continue without https://? (y/N):\n'); + const confirmLocalhost = await rl.question('\nAre you sure you want to continue without https://? (y/N):\n'); if (confirmLocalhost.toLowerCase() !== 'y') { - console.log(`\nExiting. If you want to learn how to set up https://, read README-ADVANCED.md for -instructions.`); + console.log(`\nSetup halted without bootstrapping the Auth0 tenant, as requested. + +To learn how to set up https://, check README-ADVANCED.md for instructions.`); return; } From 3112098550c850f03bf06bc719da84770950801f Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Wed, 28 Aug 2024 13:51:09 -0300 Subject: [PATCH 10/10] Reinforce reason for advanced configuration on localhost in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e6ef83ff..3d347f167 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ Run the following command: npm run auth0:bootstrap ``` -The script will prompt you to provide an **application base URL**, which defaults to http://localhost:3000. If you're configuring the application to run with HTTPS or on a production URL, this is your opportunity to set it. Learn more about this in [README-ADVANCED.md](README-ADVANCED.md). +The script will prompt you to provide an **application base URL**, which defaults to http://localhost:3000. If you're configuring the application to run with HTTPS or on a production URL, this is your opportunity to set it. One reason to take note of this is that organization invites sent to emails will NOT work by default if you use localhost. Learn more about this in [README-ADVANCED.md](README-ADVANCED.md). > [!TIP] > If you want to skip this prompt you can run the bootstrapping command with an argument: