Files
pretix_original/src/pretix/static/pretixcontrol/js/auth.js
T
Raphael MichelandKara Engelhardt d85e52c83e ESlint: Ignore vendored and pre-vue code (#6541)
* ESlint: Ignore vendored and pre-vue code

* Format pre-vue code with eslint where possible

---------

Co-authored-by: Kara Engelhardt <engelhardt@pretix.eu>
2026-09-10 12:35:10 +02:00

22 lines
680 B
JavaScript

let hiddenfield = document.querySelector('input[name=origin][type=hidden]')
if (hiddenfield) {
hiddenfield.value = window.location.origin
}
async function runCheck () {
if (document.getElementById('good_origin')) {
if (document.getElementById('good_origin').innerText.split('').reverse().join('') !== window.location.origin) {
const _response = await fetch(document.getElementById('bad_origin_report_url').innerText.split('').reverse().join(''), {
method: 'POST',
mode: 'cors',
referrerPolicy: 'unsafe-url',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'origin=' + window.location.origin,
})
}
}
}
runCheck()