From c35c8791f9ccb2fd29b3a94f6641feb3d83a2965 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 18 Jun 2019 23:13:19 +0200 Subject: [PATCH] don't forget password on connection errors (fixes #783) --- terminus-ssh/src/services/ssh.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminus-ssh/src/services/ssh.service.ts b/terminus-ssh/src/services/ssh.service.ts index 82e7abe4..d0b85eda 100644 --- a/terminus-ssh/src/services/ssh.service.ts +++ b/terminus-ssh/src/services/ssh.service.ts @@ -66,7 +66,7 @@ export class SSHService { privateKey = (await fs.readFile(privateKeyPath)).toString() } catch (error) { log('Could not read the private key file') - this.toastr.warning('Could not read the private key file') + this.toastr.error('Could not read the private key file') } if (privateKey) { @@ -100,7 +100,9 @@ export class SSHService { this.zone.run(resolve) }) ssh.on('error', error => { - this.passwordStorage.deletePassword(session.connection) + if (error.message === 'All configured authentication methods failed') { + this.passwordStorage.deletePassword(session.connection) + } this.zone.run(() => { if (connected) { this.toastr.error(error.toString())