From 005cce4acf954804c58619ff7f3b1b521f2b0e47 Mon Sep 17 00:00:00 2001 From: Elizabeth Cray Date: Sun, 26 Jun 2022 05:55:48 +0000 Subject: [PATCH] Fixed trailing newline issue with key validation --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index bfcf488..4382568 100644 --- a/index.js +++ b/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{