Skip to content

Commit

Permalink
Mitigating an XSS shown by snyk
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckinghamAJ committed Apr 23, 2024
1 parent b2220d4 commit 778da5d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@

// TO-DO: build this into an angular hook rather than this hack
function errorUpdater() {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has("error")) {
const el = document.getElementById("login-error");
el.innerHTML = '<p>' + urlParams.get('error') + '</p>';
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has("error")) {
const el = document.getElementById("login-error");
const p = document.createElement('p');
p.textContent = urlParams.get('error');
el.appendChild(p);
}
}
setTimeout( errorUpdater, 1000);
Expand Down

0 comments on commit 778da5d

Please sign in to comment.