Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _add_new_security_token() {
this._stop_security_token_watch_dog();
this.lastTokenId += 1;
this.channelId = this.__hash;
assert(this.channelId > 0);
const securityToken = new ChannelSecurityToken({
channelId: this.channelId,
createdAt: new Date(), // now
revisedLifetime: this.revisedLifetime,
tokenId: this.lastTokenId // todo ?
});
assert(!hasTokenExpired(securityToken));
assert(_.isFinite(securityToken.revisedLifetime));
this.securityToken = securityToken;
debugLog("SecurityToken", securityToken.tokenId);
this._start_security_token_watch_dog();
}