From c91d78fe51c03fd4f85e1a4d8eac0c24133f040f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 29 Apr 2020 16:44:14 +0200 Subject: [PATCH] Also export template hash --- lib/models/layergroup-token.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/models/layergroup-token.js b/lib/models/layergroup-token.js index 1e4a6951..5332ce0d 100644 --- a/lib/models/layergroup-token.js +++ b/lib/models/layergroup-token.js @@ -4,7 +4,7 @@ * @param {String} token might match the following pattern: {user}@{tpl_id}@{token}:{cache_buster} */ function parse (token) { - var signer, cacheBuster; + var signer, cacheBuster, templateHash; var tokenSplit = token.split(':'); @@ -17,7 +17,7 @@ function parse (token) { if (tokenSplit.length > 1) { signer = tokenSplit.shift(); if (tokenSplit.length > 1) { - /* var template_hash = */tokenSplit.shift(); // unused + templateHash = tokenSplit.shift(); } token = tokenSplit.shift(); } @@ -25,7 +25,9 @@ function parse (token) { return { token: token, signer: signer, - cacheBuster: cacheBuster + cacheBuster: cacheBuster, + templateHash: templateHash }; } + module.exports.parse = parse;