From cc1eb7ca13fe023d8f4de462ca74195714572651 Mon Sep 17 00:00:00 2001 From: Matias Woloski Date: Sun, 1 Sep 2013 00:27:14 -0300 Subject: [PATCH] show app chooser only if is not embedded --- app.js | 3 ++- sdk/demos-routes.js | 2 ++ sdk/index.jade | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index c96ecfe..a19c487 100644 --- a/app.js +++ b/app.js @@ -105,6 +105,7 @@ var defaultValues = function (req, res, next) { }; var embedded = function (req, res, next) { + res.locals.embedded = false; if (req.query.e || req.query.callback) { res.locals.base_url = nconf.get('DOMAIN_URL_DOCS'); res.locals.embedded = true; @@ -135,7 +136,7 @@ var overrideIfAuthenticated = function (req, res, next) { if(err) { winston.error("error: " + err); return next(err); - return next(err);callback } + } if (clients.length === 0) return next(); diff --git a/sdk/demos-routes.js b/sdk/demos-routes.js index 97af566..3f647a2 100644 --- a/sdk/demos-routes.js +++ b/sdk/demos-routes.js @@ -20,6 +20,8 @@ module.exports = function (app) { getDb(function (db) { db.collection('connections').find({client_id: client.clientID, status: true}).toArray(function(err, connections) { + if (err) return res.send(err); + res.locals.connections = connections; next(); }); diff --git a/sdk/index.jade b/sdk/index.jade index 377dc62..a7df8b2 100644 --- a/sdk/index.jade +++ b/sdk/index.jade @@ -1,6 +1,6 @@ p There are different ways of integrating Auth0 in your site. Below, some of them with a preview and a code snippet to copy paste. -if account.loggedIn +if account.loggedIn && !embedded div label Select one of your applications: select#client-chooser