Skip to content

Commit b8b6b97

Browse files
Merge pull request #231 from fcojfernandez/JENKINS-74917
[JENKINS-74917] Fix adjunct script to validate the passphrase when the SSH private key is entered directly
2 parents 83f2e91 + cd5efe0 commit b8b6b97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/resources/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey/passphraseChangeEvent.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ const passphraseElements = document.getElementsByClassName('sshCredentials_passp
44
if (passphraseElements.length > 0) {
55
// Failsafe in case there's more than 1 element we'll only use the first one. Should not happen.
66
passphraseElements[0].addEventListener("change", event => {
7-
var newEvent = new Event("change")
8-
const privateKeyElements = document.getElementsByClassName('sshCredentials_privateKey');
9-
if (passphraseElements.length > 0) {
7+
var newEvent = new Event("change", {"bubbles": true})
8+
const privateKeyElements = document.getElementsByName('_.privateKey');
9+
if (privateKeyElements.length > 0) {
1010
privateKeyElements[0].dispatchEvent(newEvent)
1111
}
1212
})

0 commit comments

Comments
 (0)