Hi Teodor,
So, I’ve set up another one of my Server Connect Actions without the Security Provider and only the Restrict.
What this action does is calculates fees through a custom module of mine. I click a button, and the fees are calculated and returned. All done through a Server Connect element.
In the following GIF, I have already invalidated the session by saving a file in Wappler. I try to run the SC, and it rightly doesn’t run but comes back with a 302 Found
status. Then you see the /public
route returned in the Fetch/XHR as stated in my restrict. As you’ll see, there is no browser redirection. Only that it returns the HTML from the route.
Below is what the same page looks like in a valid session.
The Server Connect action that this refers to:
So my question is that if a session becomes invalidated for whatever reason, and a SC is loaded, the Server Connect action will not redirect because it’s through a Server Connect Component? Thus actually NEEDING to set up a Dynamic Event on the SC Component for Unauthorized etc to get a redirection.
I will add that the Server Side Data is set on the page to my userDetails
SC Action, and trying to navigate to the page with an invalid session does redirect to the /public
route.
USER DETAILS ACTION
Page Server Side Data