From cd1261418a691d3e1507e8737110b0642c891b1f Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Mon, 19 Jun 2023 01:14:18 -0500 Subject: [PATCH] Added code to redirect the user if they are permitted to access the GLink, and show an error JS alert if they are not --- reqloc.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reqloc.html b/reqloc.html index e9ed390..2eaa7f2 100644 --- a/reqloc.html +++ b/reqloc.html @@ -17,7 +17,11 @@ var request; function requestHandler() { if (request.readyState === XMLHttpRequest.DONE) { if (request.status === 200) { - alert(request.responseText); + if (request.responseText == "B") { + alert("You are not authorized to access this GLink, as you are outside the permitted radius. If you think this is an error, please try again on a mobile device."); + } else { + window.location.replace(request.responseText); + } } else { console.log("Error sending data to server."); }