Fixed trailing newline issue with key validation

This commit is contained in:
Elizabeth Cray 2022-06-26 05:55:48 +00:00
parent 587aa53c23
commit 005cce4acf

View File

@ -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{