Browse Source

misc small fixes

loopback
tigerbot 7 years ago
parent
commit
403ec90c2d
  1. 18
      admin/public/js/app.js
  2. 1
      lib/tunnel-client-manager.js
  3. 2
      packages/apis/com.daplie.goldilocks/index.js

18
admin/public/js/app.js

@ -11,7 +11,12 @@ angular.module('com.daplie.cloud', [ 'org.oauth3' ])
return Oauth3.PromiseA.resolve(session);
};
var auth = Oauth3.create();
auth.setProvider('oauth3.org');
auth.setProvider('oauth3.org').then(function () {
auth.checkSession().then(function (session) {
console.log('hasSession?', session);
});
});
window.oauth3 = auth; // debug
return auth;
} ])
@ -139,8 +144,13 @@ angular.module('com.daplie.cloud', [ 'org.oauth3' ])
vm.authenticate = function () {
// TODO authorization redirect /api/org.oauth3.consumer/authorization_redirect/:provider_uri
var opts = {
type: 'popup'
, scope: 'domains,dns'
// , debug: true
};
return oauth3.authenticate().then(function (session) {
return oauth3.authenticate(opts).then(function (session) {
console.info("Authorized Session", session);
return oauth3.api('domains.list').then(function (domains) {
@ -249,10 +259,6 @@ angular.module('com.daplie.cloud', [ 'org.oauth3' ])
});
};
oauth3.checkSession().then(function (session) {
console.log('hasSession?', session);
});
/*
console.log('OAUTH3.PromiseA', OAUTH3.PromiseA);
return oauth3.setProvider('oauth3.org').then(function () {

1
lib/tunnel-client-manager.js

@ -93,7 +93,6 @@ module.exports.create = function (deps, config) {
}
};
console.log(directives);
return OAUTH3.api(directives.api, opts).then(function (result) {
console.log('got a token from the tunnel server?');
result.owner = owner;

2
packages/apis/com.daplie.goldilocks/index.js

@ -138,7 +138,7 @@ module.exports.create = function (deps, conf) {
return scmp(tid, token.id);
})) {
console.log('adds new owner with existing owner');
return deps.storage.owners.set(id, session);
return deps.storage.owners.set(tid, session);
}
}).then(function () {
res.setHeader('Content-Type', 'application/json;');

Loading…
Cancel
Save