Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/controllers/gpgAuthController.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
*/
const fs = require('fs');
const os = require('os');
const MfaController = require('./mfaController.js');
const Compat = require('../lib/phpjs.js');
const CookieStore = require('tough-cookie-file-store');
Expand Down Expand Up @@ -49,6 +51,11 @@ class GpgAuthController extends MfaController {

// Session cookie
this.COOKIE_FILE = `${this.appDir}/app/tmp/cookie.json`;
if (!fs.existsSync(this.COOKIE_FILE)) {
this.COOKIE_FILE = `${os.homedir()}/.local/share/passbolt/cookie.json`;

fs.mkdirSync(`${os.homedir()}/.local/share/passbolt/`);
}
this.cookieStore = new CookieStore(this.COOKIE_FILE);
this.cookieJar = this._request.jar(this.cookieStore);
this._request.defaults({jar: this.cookieJar});
Expand Down