Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function addCookie(req, key, value) {
const cookie = request.cookie(`${key}=${value}`);
const jar = request.jar();
jar.setCookie(cookie, req.uri.split('?')[0]);
req.jar = jar;
return req;
}
return new Promise(function(resolve, reject) {
fs.unlinkSync("pc-cookie.json");
cookieJar = request.jar(new cookieStore('./pc-cookie.json'));
this.csrf = null;
resolve();
});
}
constructor (setting) {
this.setCookieJar(request.jar());
this.setScope(setting.scope || fullScopes);
for (var key of ['app','key','login','phone','pass','version','proxy']) {
this[key] = setting[key] || null;
}
if (this.login === null) {
this.login = this.phone;
}
this._capthaHandler = null;
this._twoFactorHandler = null;
}
constructor (vk) {
this.vk = vk;
this.jar = request.jar();
this._captchaAttempts = 0;
}