oauth3.js/oauth3.domains.js

20 lines
564 B
JavaScript
Raw Normal View History

2017-02-28 01:19:01 +00:00
;(function (exports) {
'use strict';
var OAUTH3 = exports.OAUTH3 = exports.OAUTH3 || require('./oauth3.core.js').OAUTH3;
OAUTH3.api['domains.list'] = function (providerUri, opts) {
var session = opts.session;
return OAUTH3.request({
method: 'GET'
, url: OAUTH3.url.normalize(providerUri)
+ '/api/com.daplie.domains/accounts/' + session.token.sub + '/registrations'
, session: session
}).then(function (res) {
2017-02-28 21:55:04 +00:00
return res.data.registrations || res.data.domains || res.data;
2017-02-28 01:19:01 +00:00
});
};
}('undefined' !== typeof exports ? exports : window));