Fixed trailing newline issue with key validation
This commit is contained in:
parent
587aa53c23
commit
005cce4acf
4
index.js
4
index.js
@ -165,6 +165,10 @@ const uploadSSH = (id, token) => {
|
||||
reader.readAsText(file, "UTF-8");
|
||||
reader.onload = function (evt) {
|
||||
var pubkey = evt.target.result;
|
||||
pubkey = pubkey.replace(/\r\n/g, "\n");
|
||||
dbp(pubkey);
|
||||
pubkey = pubkey.replace(/\n/g, "");
|
||||
dbp(pubkey);
|
||||
if(validatePubKey(pubkey)){
|
||||
sendSSH(pubkey, id, token);
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user