Polish credential related logic

This commit is contained in:
Bob Sun 2017-04-28 20:33:41 -07:00
parent 649d709369
commit 1311962dc1
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
7 changed files with 140 additions and 213 deletions

View file

@ -43,32 +43,7 @@ class SSHKeySettingTableViewController: UITableViewController {
Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil)
}
Defaults[.gitSSHKeySource] = "url"
let alert = UIAlertController(
title: "PGP Passphrase",
message: "Please fill in the passphrase for your Git Repository SSH key.",
preferredStyle: UIAlertControllerStyle.alert
)
alert.addAction(
UIAlertAction(
title: "OK",
style: UIAlertActionStyle.default,
handler: {_ in
Utils.addPasswordToKeychain(
name: "gitSSHPrivateKeyPassphrase",
password: alert.textFields!.first!.text!
)
self.navigationController!.popViewController(animated: true)
}
)
)
alert.addTextField(
configurationHandler: {(textField: UITextField!) in
textField.text = self.passwordStore.gitSSHPrivateKeyPassphrase
textField.isSecureTextEntry = true
})
self.present(alert, animated: true, completion: nil)
self.navigationController!.popViewController(animated: true)
}
}