Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createGToken(
callback: (err: Error|null, token: GoogleToken) => void) {
if (this.gtoken) {
return callback(null, this.gtoken);
} else {
const opts = {
iss: this.email,
sub: this.subject,
scope: this.scopes,
keyFile: this.keyFile,
key: this.key
} as TokenOptions;
this.gtoken = new GoogleToken(opts);
return callback(null, this.gtoken);
}
}
}
JWT.prototype.createGToken = function () {
if (!this.gtoken) {
this.gtoken = new gtoken_1.GoogleToken({
iss: this.email,
sub: this.subject,
scope: this.scopes,
keyFile: this.keyFile,
key: this.key,
additionalClaims: this.additionalClaims
});
}
return this.gtoken;
};
/**