diff --git a/NEWS.md b/NEWS.md index 2d274f15..667bb9a1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 ------------------- diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index 4dcf3640..079c7588 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -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) {