@@ -20,18 +20,33 @@ public function handleRequest($customerId, $secretKey, $observer)
2020 $ configProvider = new IntegrationInfoProvider ();
2121 $ configText = $ configProvider ->getIntegrationInfo (true );
2222 $ fullUrl = $ this ->getFullRequestUri ();
23- $ result = \QueueIT \KnownUserV3 \SDK \KnownUser::validateRequestByIntegrationConfig ($ fullUrl ,
24- $ queueittoken , $ configText ,$ customerId , $ secretKey );
25-
23+ $ currentUrlWithoutQueueitToken = preg_replace ( "/([ \\?&])( " ."queueittoken " . "=[^&]*)/i " , "" , $ fullUrl );
24+
25+ $ result = \QueueIT \KnownUserV3 \SDK \KnownUser::validateRequestByIntegrationConfig (
26+ $ currentUrlWithoutQueueitToken ,
27+ $ queueittoken ,
28+ $ configText ,
29+ $ customerId ,
30+ $ secretKey );
2631
2732 if ($ result ->doRedirect ())
2833 {
29- $ response = $ action ->getResponse ();
30-
34+ $ response = $ action ->getResponse ();
35+
3136 $ response ->setHeader ('Expires ' , 'Fri, 01 Jan 1990 00:00:00 GMT ' );
3237 $ response ->setHeader ('Cache-Control ' , 'no-store, no-cache, must-revalidate, max-age=0 ' );
3338 $ response ->setHeader ('Pragma ' , 'no-cache ' );
34- $ response ->setRedirect ($ result ->redirectUrl )->sendResponse ();
39+
40+ if (!$ result ->isAjaxResult )
41+ {
42+ $ response ->setRedirect ($ result ->redirectUrl )->sendResponse ();
43+ }
44+ else
45+ {
46+ $ response ->setHeader ($ result ->getAjaxQueueRedirectHeaderKey (), $ result ->getAjaxRedirectUrl ());
47+ $ response ->sendResponse ();
48+ }
49+
3550 return ;
3651 }
3752
0 commit comments