From f8cf1996a2aad716dc29555a3bd59e55426019f3 Mon Sep 17 00:00:00 2001 From: Tobias Date: Thu, 17 Jan 2019 11:40:11 +1300 Subject: [PATCH] Display QR Code warning on checkin --- .../regidesk/templates/regidesk/ci_landing.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vendor/regidesk/regidesk/templates/regidesk/ci_landing.html b/vendor/regidesk/regidesk/templates/regidesk/ci_landing.html index 01a7245a..de9479c5 100644 --- a/vendor/regidesk/regidesk/templates/regidesk/ci_landing.html +++ b/vendor/regidesk/regidesk/templates/regidesk/ci_landing.html @@ -13,7 +13,8 @@

Check-in

Please scan QR Code or enter it below

- +

+
@@ -37,9 +38,12 @@ // 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 // 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)) { - 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"; } });