Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var tough = require('tough-cookie');
var Store = tough.Store;
var permuteDomain = tough.permuteDomain;
var permutePath = tough.permutePath;
var util = require('util');
var fs = require('fs');
function FileCookieStore(filePath) {
Store.call(this);
this.idx = {}; // idx is memory cache
this.filePath = filePath;
var self = this;
loadFromFile(this.filePath, function(dataJson) {
if (dataJson)
self.idx = dataJson;
})
}
util.inherits(FileCookieStore, Store);
const tough = require('tough-cookie'),
Store = tough.Store,
permuteDomain = tough.permuteDomain,
permutePath = tough.permutePath,
fs = require('fs'),
helpers = require('./helpers'),
path = require('path');
class CookieFilestore extends Store {
constructor() {
super();
this.synchronous = true;
this.filePath = path.join(process.env.HOME, '.raiden', 'cookies.json');
this.cookies = this._loadFromDisk();