Button click not working after Published API is called in background

0
Hi ,   I have Cross Origin iframe on Mendix Page. On this Iframe there is "Validate Card" button , on click of which we get response on Mendix published API. This callback is happening with different user and session which is different from original user and session. I observed that once I click on Validate button, some of the other functionalities on Parent page are not working. For example we have "Back" button which shows previous page. But issue is , its not opening page and only shows Spinner . On checking console logs I found below info.    XAS instance '4e2bfdf7-9770-4c0c-933d-a135efce316b' expired, removing this instance now. Rescheduling running tasks for expired XAS instance '4e2bfdf7-9770-4c0c-933d-a135efce316b'.       If I don't click 'Validate Card' (in this case Published API is not called ) , then Back button is working.  
asked
1 answers
0

Hi Shriram, issue is happening because the Validate Card button in the iframe is calling a Mendix published API using a different or anonymous session. When that API call hits, Mendix creates a new session or client instance, which causes the original session on the parent page to expire. That’s why buttons like Back stop working.

 

To avoid this, make the published API anonymous or route the API call through an external middleware instead of calling it directly from the iframe. This prevents any session conflict and keeps the Mendix client stable.

 

I hope this one helps you! :)

answered