Skip to content

Commit 90230f9

Browse files
authored
Update README.md
Supporting Ajax Calls
1 parent 2de80f2 commit 90230f9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,15 @@ catch(\Exception $e)
183183
If you have some static html pages (might be behind cache servers) and you have some ajax calls from those pages needed to be protected by KnownUser library you need to follow these steps:
184184
1) You are using v.3.5.1 (or later) of the KnownUser library.
185185
2) Make sure KnownUser code will not run on static pages (by ignoring those URLs in your integration configuration).
186-
3) Protect static pages by including this Javascript code:
186+
3) Add below JavaScript tags to static pages :
187187
```
188+
<script type="text/javascript" src="//static.queue-it.net/script/queueclient.min.js"></script>
188189
<script
189-
type="text/javascript"
190-
src="//static.queue-it.net/script/knownuserv3.js">
190+
data-queueit-intercept-domain="{YOUR_CURRENT_DOMAIN}"
191+
data-queueit-intercept="true"
192+
data-queueit-c="{YOUR_CUSTOMER_ID}"
193+
type="text/javascript"
194+
src="//static.queue-it.net/script/queueconfigloader.min.js">
191195
</script>
192196
```
193197
4) Use the following method to protect all dynamic calls (including dynamic pages and ajax calls).
@@ -229,7 +233,7 @@ try
229233

230234
die();
231235
}
232-
if(!empty($queueittoken))
236+
if(!empty($queueittoken) && !empty($result->actionType))
233237
{
234238
//Request can continue - we remove queueittoken from querystring parameter to avoid sharing of user specific token
235239
header('Location: '.str_replace("?queueittoken=".$queueittoken,"", getFullRequestUri()));

0 commit comments

Comments
 (0)