mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-09-25 19:19:00 +02:00
Expose (temporarily) the session ids.
This commit is contained in:
parent
f619d3f9a7
commit
53af1f5fdd
12
src/api.js
12
src/api.js
@ -534,6 +534,18 @@ Api.fn.xo = {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'getSessionId': function (req) {
|
||||||
|
var p_pool_id = req.params.id;
|
||||||
|
if (undefined === p_pool_id)
|
||||||
|
{
|
||||||
|
throw Api.err.INVALID_PARAMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.xo.pools.first(p_pool_id).then(function (pool) {
|
||||||
|
return pool.get('sessionId');
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Api.fn.host = {
|
Api.fn.host = {
|
||||||
|
@ -353,6 +353,9 @@ Xo.prototype.start = function () {
|
|||||||
pools = _.values(pools);
|
pools = _.values(pools);
|
||||||
var pool_uuid = pools[0].id = pools[0].uuid;
|
var pool_uuid = pools[0].id = pools[0].uuid;
|
||||||
|
|
||||||
|
// @todo Remove: security concerns.
|
||||||
|
pools[0].sessionId = xapi.sessionId;
|
||||||
|
|
||||||
var resolve = function (model, collection, props, include) {
|
var resolve = function (model, collection, props, include) {
|
||||||
/* jshint laxbreak: true */
|
/* jshint laxbreak: true */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user