I have tried adding a browser element and controlling the navigation through the dynamic events as per the pic below but the form still shows me the API response instead of either staying on the login page or navigating to the user dashboard.
You need to use the Response step to return a non-authorised HTTP error code (401) if the login fails. On your server-action, you can check if the login was successful based on the contents of api.data (use a Condition step). And only then you can use the Dynamic Events to check if the login was successful or not authorised
Can you show a screenshot? That sounds really weird
I had to disable the pass error flag on the API call.
Still haven’t figured out how to make a call and stay on the page though.
Also, is my solution correct? Not too happy with the redirect calls, was expecting to be able to use the router to navigate through the pages rather than issuing a server redirect page call…
Good catch on the pass error thing, always untick that box to prevent hard to find “bugs” (I complained about it in the past)
Instead of server redirect steps, use the response step and specify the status code to 200 if success, 401 if unauthorised, and then you can use Dynamic Events on the front-end
But how can I dynamically navigate the user from the login page to the dashboard page without using the (server) redirect? With reactJS I used the router navigate on the client side, not sure here on node with wappler… TIA