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:
parent
747e6cebe2
commit
51df81393d
@ -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),
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user