show app chooser only if is not embedded
This commit is contained in:
Родитель
9cc4b2c153
Коммит
cc1eb7ca13
3
app.js
3
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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче