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