max_age is optional now

This commit is contained in:
Martin Zimmermann 2014-07-24 10:15:22 +02:00
parent 8d71ad6c1c
commit f42e70c768

View File

@ -30,10 +30,6 @@ define(function() {
*/
return function(val, max_age) {
if (typeof max_age === "undefined") {
max_age = 900;
}
var _ = val.split(".", 3),
payload = _[0], ts = _[1], signature = _[2];
@ -42,7 +38,7 @@ define(function() {
}
var age = (new Date()).getTime() / 1000 - timestamp(decode(ts));
if (age > max_age) {
if (typeof max_age !== "undefined" && age > max_age) {
return null;
}