1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01:00

Use local storage for browser's secure storage (#8231)

UI warns the user whenever using secure storage in browser that it's
insecure. This is not a change from the current background behavior,
just uses the already existing services in each context.
This commit is contained in:
Matt Gibson 2024-03-11 16:51:09 -05:00 committed by GitHub
parent 747e6cebe2
commit 51df81393d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -352,7 +352,7 @@ export default class MainBackground {
this.cryptoFunctionService = new WebCryptoFunctionService(self);
this.keyGenerationService = new KeyGenerationService(this.cryptoFunctionService);
this.storageService = new BrowserLocalStorageService();
this.secureStorageService = new BrowserLocalStorageService();
this.secureStorageService = this.storageService; // secure storage is not supported in browsers, so we use local storage and warn users when it is used
this.memoryStorageService = BrowserApi.isManifestVersion(3)
? new LocalBackedSessionStorageService(
new EncryptServiceImplementation(this.cryptoFunctionService, this.logService, false),

View File

@ -417,7 +417,7 @@ function getBgService<T>(service: keyof MainBackground) {
},
{
provide: SECURE_STORAGE,
useFactory: getBgService<AbstractStorageService>("secureStorageService"),
useExisting: AbstractStorageService, // Secure storage is not available in the browser, so we use normal storage instead and warn users when it is used.
},
{
provide: MEMORY_STORAGE,