Display QR Code warning on checkin
This commit is contained in:
parent
f83383aca4
commit
f8cf1996a2
1 changed files with 7 additions and 3 deletions
|
@ -13,7 +13,8 @@
|
||||||
<div class="my-5 col-12">
|
<div class="my-5 col-12">
|
||||||
<h2>Check-in</h2>
|
<h2>Check-in</h2>
|
||||||
<p>Please scan QR Code or enter it below</p>
|
<p>Please scan QR Code or enter it below</p>
|
||||||
<video id="preview"" autoplay style="width: 500px; height: 500px; border: 1px solid green;"></video>
|
<p><strong id="note"></strong></p>
|
||||||
|
<video id="preview"" autoplay style="width: 500px; height: 500px; border: 1px solid green;"></video>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="my-5 col-12">
|
<div class="my-5 col-12">
|
||||||
|
@ -37,9 +38,12 @@
|
||||||
// considering we have quite a few domains right now.
|
// considering we have quite a few domains right now.
|
||||||
// We simply validate that the domain ends in an OK format, which isn't ideal but should give us
|
// We simply validate that the domain ends in an OK format, which isn't ideal but should give us
|
||||||
// enough reassurance for the time being. 2020 Can fix this :P
|
// enough reassurance for the time being. 2020 Can fix this :P
|
||||||
var checkin_re = new RegExp('\/checkin\/[A-Z0-9]{6}\.png$');
|
var checkin_re = new RegExp('[A-Z0-9]{6}');
|
||||||
if (checkin_re.test(content)) {
|
if (checkin_re.test(content)) {
|
||||||
window.location.href = content;
|
document.getElementById('note').textContent = "Code " + content + " found. Redirecting ...";
|
||||||
|
window.location.href = window.location.href + content;
|
||||||
|
} else {
|
||||||
|
document.getElementById('note').textContent = "INVALID code " + content + " found";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue