Also export template hash

This commit is contained in:
Daniel García Aubert
2020-04-29 16:44:14 +02:00
parent 798d010776
commit c91d78fe51
+5 -3
View File
@@ -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;