diff --git a/app.js b/app.js index ca04380..1fdb277 100644 --- a/app.js +++ b/app.js @@ -298,15 +298,25 @@ docsapp.addPreRender(overrideIfClientInQsForPublicAllowedUrls); docsapp.addPreRender(appendTicket); docsapp.addPreRender(embedded); docsapp.addPreRender(function(req,res,next){ - if(process.env.NODE_ENV === 'production') { - res.locals.uiURL = 'https://' + nconf.get('DOMAIN_URL_APP'); - res.locals.sdkURL = 'https://' + nconf.get('DOMAIN_URL_SDK'); - res.locals.widget_url = nconf.get('LOGIN_WIDGET_URL'); - } else { - res.locals.uiURL = 'http://' + nconf.get('DOMAIN_URL_APP'); - res.locals.sdkURL = 'http://' + nconf.get('DOMAIN_URL_SDK'); - res.locals.widget_url = nconf.get('LOGIN_WIDGET_URL'); + var scheme = process.env.NODE_ENV === 'production' ? 'https' : 'http'; + + res.locals.uiURL = scheme + '://' + nconf.get('DOMAIN_URL_APP'); + res.locals.sdkURL = scheme + '://' + nconf.get('DOMAIN_URL_SDK'); + + function removeScheme(url) { + return url.slice(url.indexOf(':') + 1); } + + // Auth0 client side Javascript URLs to use + res.locals.auth0js_url = nconf.get('AUTH0JS_URL'); + res.locals.auth0js_url_no_scheme = removeScheme(nconf.get('AUTH0JS_URL')); + + res.locals.auth0_angular_url = nconf.get('AUTH0_ANGULAR_URL'); + res.locals.auth0_angular_url_no_scheme = removeScheme(nconf.get('AUTH0_ANGULAR_URL')); + + res.locals.widget_url = nconf.get('LOGIN_WIDGET_URL'); + res.locals.widget_url_no_scheme = removeScheme(nconf.get('LOGIN_WIDGET_URL')); + next(); }); diff --git a/docs/angular-tutorial.md b/docs/angular-tutorial.md index 3718ed8..00503d7 100644 --- a/docs/angular-tutorial.md +++ b/docs/angular-tutorial.md @@ -11,8 +11,8 @@ If you already have an existing application, please follow the steps below. - - + + diff --git a/docs/custom-signup.md b/docs/custom-signup.md index d8624b3..2822bc0 100644 --- a/docs/custom-signup.md +++ b/docs/custom-signup.md @@ -24,7 +24,7 @@ Notice that `color` and `food` are custom fields and we will be storing them too ### 2. Add the Auth0 Widget to it ```html - + ``` ```js diff --git a/docs/java-tutorial.md b/docs/java-tutorial.md index 6578928..4ea95a2 100644 --- a/docs/java-tutorial.md +++ b/docs/java-tutorial.md @@ -161,7 +161,7 @@ Next step is to add a Login Page (`/login.jsp`) with the custom widget of the pr Login - + - - + + diff --git a/docs/new/client-platforms/jquery.md b/docs/new/client-platforms/jquery.md index 518c075..2909b82 100644 --- a/docs/new/client-platforms/jquery.md +++ b/docs/new/client-platforms/jquery.md @@ -22,7 +22,7 @@ Otherwise, please follow the steps below to configure your app to use jQuery wit ````html - + diff --git a/docs/new/client-platforms/vanillajs.md b/docs/new/client-platforms/vanillajs.md index 825eb80..747178e 100644 --- a/docs/new/client-platforms/vanillajs.md +++ b/docs/new/client-platforms/vanillajs.md @@ -10,7 +10,7 @@ Please follow the steps below to configure your JS app to use Auth0. ````html - + diff --git a/docs/scenarios-unbounce.md b/docs/scenarios-unbounce.md index 47175a7..b838d6e 100644 --- a/docs/scenarios-unbounce.md +++ b/docs/scenarios-unbounce.md @@ -18,7 +18,7 @@ 1. Add a new JavaScript to your Unbounce landing page and replace the Auth0 domain and client id with the values you've got from Auth0. Also make sure to check jQuery as a dependency. ``` - +