Skip to content

Commit 4dfdbcd

Browse files
committed
fix(ssh): fix ssh password being ignored
Closes #13
1 parent ed892b7 commit 4dfdbcd

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

client/actions.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,22 @@ const actions = {
3030
});
3131

3232
try {
33-
conn.connect({
34-
host: config.sshHost,
35-
port: config.sshPort || 22,
36-
username: config.sshUser,
37-
privateKey: config.sshKey,
38-
passphrase: config.sshKeyPassphrase
39-
});
33+
if (config.sshKey) {
34+
conn.connect({
35+
host: config.sshHost,
36+
port: config.sshPort || 22,
37+
username: config.sshUser,
38+
privateKey: config.sshKey,
39+
passphrase: config.sshKeyPassphrase
40+
});
41+
} else {
42+
conn.connect({
43+
host: config.sshHost,
44+
port: config.sshPort || 22,
45+
username: config.sshUser,
46+
password: config.sshPassword
47+
});
48+
}
4049
} catch (err) {
4150
dispatch({ type: 'disconnect' });
4251
alert(`SSH Error: ${err.message}`);

0 commit comments

Comments
 (0)