1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-12 01:48:21 +02:00

don't use innerHTML for sso handOffMessage (#1285)

This commit is contained in:
Kyle Spearrin 2021-11-09 12:15:58 -05:00 committed by GitHub
parent 5b6fb16591
commit f8aea1e861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,8 +25,11 @@ function initiateBrowserSso(code: string, state: string) {
window.postMessage({ command: 'authResult', code: code, state: state }, '*');
const handOffMessage = ('; ' + document.cookie).split('; ssoHandOffMessage=').pop().split(';').shift();
document.cookie = 'ssoHandOffMessage=;SameSite=strict;max-age=0';
document.getElementById('content').innerHTML =
`<p>${handOffMessage}</p>`;
let content = document.getElementById('content');
content.innerHTML = '';
let p = document.createElement('p');
p.innerText = handOffMessage;
content.appendChild(p);
}
function extractFromRegex(s: string, regexString: string) {