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.readAsText(file, "UTF-8");
|
||||||
reader.onload = function (evt) {
|
reader.onload = function (evt) {
|
||||||
var pubkey = evt.target.result;
|
var pubkey = evt.target.result;
|
||||||
|
pubkey = pubkey.replace(/\r\n/g, "\n");
|
||||||
|
dbp(pubkey);
|
||||||
|
pubkey = pubkey.replace(/\n/g, "");
|
||||||
|
dbp(pubkey);
|
||||||
if(validatePubKey(pubkey)){
|
if(validatePubKey(pubkey)){
|
||||||
sendSSH(pubkey, id, token);
|
sendSSH(pubkey, id, token);
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
Reference in New Issue
Block a user