Permalink
Browse files

secrets pulled from seaport work again

  • Loading branch information...
1 parent 15c8edb commit 6ac2db8db7568a162ed0245ca5a001e7be195302 @substack committed Sep 2, 2013
Showing with 11 additions and 2 deletions.
  1. +11 −2 index.js
View
@@ -62,8 +62,17 @@ Airport.prototype.connect = function (opts, fn) {
if (expired) return;
clearTimeout(timeout);
- queue.forEach(function (cb) { cb(ref) });
- queue = [];
+ if (s.secret && ref && typeof ref.secret === 'function') {
+ ref.secret(s.secret, function (err, ref_) {
+ if (err) return target.emit('error', err);
+ queue.forEach(function (cb) { cb(ref_) });
+ queue = [];
+ });
+ }
+ else {
+ queue.forEach(function (cb) { cb(ref) });
+ queue = [];
+ }
});
u.on('up', function () {
if (expired) return;

0 comments on commit 6ac2db8

Please sign in to comment.