Skip to content

Commit

Permalink
prefer saved password to keyboard interactive auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jan 29, 2025
1 parent 4197cef commit 5d2d179
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tabby-ssh/src/session/ssh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@ export class SSHSession {
})
}
}
if (!this.profile.options.auth || this.profile.options.auth === 'keyboardInteractive') {
const savedPassword = this.profile.options.password ?? await this.passwordStorage.loadPassword(this.profile)
if (savedPassword) {
this.allAuthMethods.push({ type: 'keyboard-interactive', savedPassword })
}
this.allAuthMethods.push({ type: 'keyboard-interactive' })
}
if (!this.profile.options.auth || this.profile.options.auth === 'password') {
if (this.profile.options.password) {
this.allAuthMethods.push({ type: 'saved-password', password: this.profile.options.password })
Expand All @@ -209,6 +202,15 @@ export class SSHSession {
if (password) {
this.allAuthMethods.push({ type: 'saved-password', password })
}
}
if (!this.profile.options.auth || this.profile.options.auth === 'keyboardInteractive') {
const savedPassword = this.profile.options.password ?? await this.passwordStorage.loadPassword(this.profile)
if (savedPassword) {
this.allAuthMethods.push({ type: 'keyboard-interactive', savedPassword })
}
this.allAuthMethods.push({ type: 'keyboard-interactive' })
}
if (!this.profile.options.auth || this.profile.options.auth === 'password') {
this.allAuthMethods.push({ type: 'prompt-password' })
}
this.allAuthMethods.push({ type: 'hostbased' })
Expand Down

0 comments on commit 5d2d179

Please sign in to comment.