2
var AuthenticationManager = function (timeToLive) {6
AuthenticationManager.prototype.generate = function (tokenId, currentTime) {7
this.map[tokenId] = currentTime + this.ttl;9
AuthenticationManager.prototype.renew = function (tokenId, currentTime) {10
let curr = this.map[tokenId];11
if (curr > currentTime) {12
this.generate(tokenId, currentTime);15
AuthenticationManager.prototype.countUnexpiredTokens = function (currentTime) {16
return Object.keys(this.map).filter((key) => this.map[key] > currentTime)