1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-28 12:35:40 +01:00

purge state on lock/logout

This commit is contained in:
Kyle Spearrin 2019-07-02 08:18:42 -04:00
parent 5bc1d2c143
commit e063c8b09d
5 changed files with 18 additions and 8 deletions

2
jslib

@ -1 +1 @@
Subproject commit 00f1aad65ea2e243713d409873dfb5d833296897 Subproject commit 2aa71f98a1f623470b3bd71306e0ef8a1ba97758

View File

@ -7,6 +7,7 @@ import { I18nService } from 'jslib/abstractions/i18n.service';
import { LockService } from 'jslib/abstractions/lock.service'; import { LockService } from 'jslib/abstractions/lock.service';
import { MessagingService } from 'jslib/abstractions/messaging.service'; import { MessagingService } from 'jslib/abstractions/messaging.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { StateService } from 'jslib/abstractions/state.service';
import { StorageService } from 'jslib/abstractions/storage.service'; import { StorageService } from 'jslib/abstractions/storage.service';
import { UserService } from 'jslib/abstractions/user.service'; import { UserService } from 'jslib/abstractions/user.service';
@ -21,8 +22,8 @@ export class LockComponent extends BaseLockComponent {
platformUtilsService: PlatformUtilsService, messagingService: MessagingService, platformUtilsService: PlatformUtilsService, messagingService: MessagingService,
userService: UserService, cryptoService: CryptoService, userService: UserService, cryptoService: CryptoService,
storageService: StorageService, lockService: LockService, storageService: StorageService, lockService: LockService,
environmentService: EnvironmentService) { environmentService: EnvironmentService, stateService: StateService) {
super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService, super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService,
storageService, lockService, environmentService); storageService, lockService, environmentService, stateService);
} }
} }

View File

@ -11,6 +11,7 @@ import { EnvironmentComponent } from './environment.component';
import { AuthService } from 'jslib/abstractions/auth.service'; import { AuthService } from 'jslib/abstractions/auth.service';
import { I18nService } from 'jslib/abstractions/i18n.service'; import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { StateService } from 'jslib/abstractions/state.service';
import { StorageService } from 'jslib/abstractions/storage.service'; import { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service'; import { SyncService } from 'jslib/abstractions/sync.service';
@ -29,8 +30,8 @@ export class LoginComponent extends BaseLoginComponent {
constructor(authService: AuthService, router: Router, constructor(authService: AuthService, router: Router,
i18nService: I18nService, syncService: SyncService, i18nService: I18nService, syncService: SyncService,
private componentFactoryResolver: ComponentFactoryResolver, storageService: StorageService, private componentFactoryResolver: ComponentFactoryResolver, storageService: StorageService,
platformUtilsService: PlatformUtilsService) { platformUtilsService: PlatformUtilsService, stateService: StateService) {
super(authService, router, platformUtilsService, i18nService, storageService); super(authService, router, platformUtilsService, i18nService, storageService, stateService);
super.onSuccessfulLogin = () => { super.onSuccessfulLogin = () => {
return syncService.fullSync(true); return syncService.fullSync(true);
}; };

View File

@ -16,6 +16,8 @@ import { AuthService } from 'jslib/abstractions/auth.service';
import { EnvironmentService } from 'jslib/abstractions/environment.service'; import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { I18nService } from 'jslib/abstractions/i18n.service'; import { I18nService } from 'jslib/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { StateService } from 'jslib/abstractions/state.service';
import { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service'; import { SyncService } from 'jslib/abstractions/sync.service';
import { ModalComponent } from 'jslib/angular/components/modal.component'; import { ModalComponent } from 'jslib/angular/components/modal.component';
@ -33,8 +35,10 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
constructor(authService: AuthService, router: Router, constructor(authService: AuthService, router: Router,
i18nService: I18nService, apiService: ApiService, i18nService: I18nService, apiService: ApiService,
platformUtilsService: PlatformUtilsService, syncService: SyncService, platformUtilsService: PlatformUtilsService, syncService: SyncService,
environmentService: EnvironmentService, private componentFactoryResolver: ComponentFactoryResolver) { environmentService: EnvironmentService, private componentFactoryResolver: ComponentFactoryResolver,
super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService); stateService: StateService, storageService: StorageService) {
super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService,
stateService, storageService);
super.onSuccessfulLogin = () => { super.onSuccessfulLogin = () => {
return syncService.fullSync(true); return syncService.fullSync(true);
}; };

View File

@ -42,6 +42,7 @@ import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { SearchService } from 'jslib/abstractions/search.service'; import { SearchService } from 'jslib/abstractions/search.service';
import { SettingsService } from 'jslib/abstractions/settings.service'; import { SettingsService } from 'jslib/abstractions/settings.service';
import { StateService } from 'jslib/abstractions/state.service';
import { StorageService } from 'jslib/abstractions/storage.service'; import { StorageService } from 'jslib/abstractions/storage.service';
import { SyncService } from 'jslib/abstractions/sync.service'; import { SyncService } from 'jslib/abstractions/sync.service';
import { SystemService } from 'jslib/abstractions/system.service'; import { SystemService } from 'jslib/abstractions/system.service';
@ -92,7 +93,8 @@ export class AppComponent implements OnInit {
private cryptoService: CryptoService, private componentFactoryResolver: ComponentFactoryResolver, private cryptoService: CryptoService, private componentFactoryResolver: ComponentFactoryResolver,
private messagingService: MessagingService, private collectionService: CollectionService, private messagingService: MessagingService, private collectionService: CollectionService,
private searchService: SearchService, private notificationsService: NotificationsService, private searchService: SearchService, private notificationsService: NotificationsService,
private platformUtilsService: PlatformUtilsService, private systemService: SystemService) { } private platformUtilsService: PlatformUtilsService, private systemService: SystemService,
private stateService: StateService) { }
ngOnInit() { ngOnInit() {
this.ngZone.runOutsideAngular(() => { this.ngZone.runOutsideAngular(() => {
@ -139,6 +141,7 @@ export class AppComponent implements OnInit {
if (this.modal != null) { if (this.modal != null) {
this.modal.close(); this.modal.close();
} }
this.stateService.purge();
this.router.navigate(['lock']); this.router.navigate(['lock']);
this.notificationsService.updateConnection(); this.notificationsService.updateConnection();
this.updateAppMenu(); this.updateAppMenu();
@ -219,6 +222,7 @@ export class AppComponent implements OnInit {
this.collectionService.clear(userId), this.collectionService.clear(userId),
this.passwordGenerationService.clear(), this.passwordGenerationService.clear(),
this.lockService.clear(), this.lockService.clear(),
this.stateService.purge(),
]); ]);
this.lockService.pinLocked = false; this.lockService.pinLocked = false;