mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-07-30 17:35:04 +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 = {
|
||||
|
@ -353,6 +353,9 @@ Xo.prototype.start = function () {
|
||||
pools = _.values(pools);
|
||||
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) {
|
||||
/* jshint laxbreak: true */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user