From b476ec57c891a8672647ea77fc19b825a097a005 Mon Sep 17 00:00:00 2001 From: Justin Baur <19896123+justindbaur@users.noreply.github.com> Date: Thu, 26 Dec 2024 08:59:30 -0500 Subject: [PATCH] Check Windows Portable For SecureStorage Support --- apps/desktop/src/platform/preload.ts | 2 ++ .../src/platform/services/electron-platform-utils.service.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/platform/preload.ts b/apps/desktop/src/platform/preload.ts index 0b61d894776..e05b5e5afdb 100644 --- a/apps/desktop/src/platform/preload.ts +++ b/apps/desktop/src/platform/preload.ts @@ -18,6 +18,7 @@ import { isFlatpak, isMacAppStore, isSnapStore, + isWindowsPortable, isWindowsStore, } from "../utils"; @@ -145,6 +146,7 @@ export default { isDev: isDev(), isMacAppStore: isMacAppStore(), isWindowsStore: isWindowsStore(), + isWindowsPortable: isWindowsPortable(), isFlatpak: isFlatpak(), isSnapStore: isSnapStore(), isAppImage: isAppImage(), diff --git a/apps/desktop/src/platform/services/electron-platform-utils.service.ts b/apps/desktop/src/platform/services/electron-platform-utils.service.ts index d19e106c068..834d511e9ba 100644 --- a/apps/desktop/src/platform/services/electron-platform-utils.service.ts +++ b/apps/desktop/src/platform/services/electron-platform-utils.service.ts @@ -132,7 +132,10 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService { } supportsSecureStorage(): boolean { - return true; + // When using windows portable it's expected that all data is stored in the local `data.json` file + // if things instead get saved into Windows Credential Manager and then the user tries to move + // their Bitwarden executable to another computer they would be unable to unlock. + return !ipc.platform.isWindowsPortable; } getAutofillKeyboardShortcut(): Promise {