Set api_key to signer's when instanciating a template map

Closes #114
This commit is contained in:
Sandro Santilli 2014-01-28 12:36:38 +01:00
parent ac31c69c80
commit 67e4e7e99b
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@
Bug fixes:
* layergroup accept both map_key and api_key (#91)
* Fix public instanciation of signed template accessign private data (#114)
1.6.2 -- 2014-01-23
-------------------

View File

@ -448,8 +448,13 @@ var CartodbWindshaft = function(serverOptions) {
fakereq = { query: {}, params: {}, headers: _.clone(req.headers) };
ws.setDBParams(cdbuser, fakereq.params, this);
},
function createLayergroup(err) {
function setApiKey(err){
if ( err ) throw err;
cartoData.getUserMapKey(cdbuser, this);
},
function createLayergroup(err, val) {
if ( err ) throw err;
fakereq.params.api_key = val;
ws.createLayergroup(layergroup, fakereq, this);
},
function signLayergroup(err, resp) {