1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-27 17:18:04 +01:00

Don't save passwords if user is logged out

This commit is contained in:
Thomas Rittson 2021-11-16 14:14:48 +10:00
parent cc9ff07aae
commit 7b3f8d4223
2 changed files with 6 additions and 3 deletions

View File

@ -256,7 +256,7 @@ export default class MainBackground {
this.commandsBackground = new CommandsBackground(this, this.passwordGenerationService,
this.platformUtilsService, this.vaultTimeoutService);
this.notificationBackground = new NotificationBackground(this, this.autofillService, this.cipherService,
this.storageService, this.vaultTimeoutService, this.policyService, this.folderService);
this.storageService, this.vaultTimeoutService, this.policyService, this.folderService, this.userService);
this.tabsBackground = new TabsBackground(this, this.notificationBackground);
this.contextMenusBackground = new ContextMenusBackground(this, this.cipherService, this.passwordGenerationService,

View File

@ -8,8 +8,11 @@ import { CipherService } from 'jslib-common/abstractions/cipher.service';
import { FolderService } from 'jslib-common/abstractions/folder.service';
import { PolicyService } from 'jslib-common/abstractions/policy.service';
import { StorageService } from 'jslib-common/abstractions/storage.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.service';
import { ConstantsService } from 'jslib-common/services/constants.service';
import { AutofillService } from '../services/abstractions/autofill.service';
import { BrowserApi } from '../browser/browserApi';
@ -34,7 +37,7 @@ export default class NotificationBackground {
constructor(private main: MainBackground, private autofillService: AutofillService,
private cipherService: CipherService, private storageService: StorageService,
private vaultTimeoutService: VaultTimeoutService, private policyService: PolicyService,
private folderService: FolderService) {
private folderService: FolderService, private userService: UserService) {
}
async init() {
@ -191,7 +194,7 @@ export default class NotificationBackground {
normalizedUsername = normalizedUsername.toLowerCase();
}
if (await this.vaultTimeoutService.isLocked()) {
if (await this.userService.isAuthenticated() && await this.vaultTimeoutService.isLocked()) {
if (!await this.allowPersonalOwnership()) {
return;
}