Просмотр исходного кода

delete saved password when deleting and ssh connection (fixes #1999)

Eugene Pankov 5 лет назад
Родитель
Сommit
fd1ea4fc49
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      terminus-ssh/src/components/sshSettingsTab.component.ts

+ 3 - 0
terminus-ssh/src/components/sshSettingsTab.component.ts

@@ -1,6 +1,7 @@
 import { Component } from '@angular/core'
 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 import { ConfigService, ElectronService, HostAppService } from 'terminus-core'
+import { PasswordStorageService } from '../services/passwordStorage.service'
 import { SSHConnection, SSHConnectionGroup } from '../api'
 import { EditConnectionModalComponent } from './editConnectionModal.component'
 import { PromptModalComponent } from './promptModal.component'
@@ -19,6 +20,7 @@ export class SSHSettingsTabComponent {
         private electron: ElectronService,
         private hostApp: HostAppService,
         private ngbModal: NgbModal,
+        private passwordStorage: PasswordStorageService,
     ) {
         this.connections = this.config.store.ssh.connections
         this.refresh()
@@ -65,6 +67,7 @@ export class SSHSettingsTabComponent {
             }
         )).response === 1) {
             this.connections = this.connections.filter(x => x !== connection)
+            this.passwordStorage.deletePassword(connection)
             this.config.store.ssh.connections = this.connections
             this.config.save()
             this.refresh()