Custom Login Page Runtime Error

0
In my application, I have a custom login page with a login button. The login button calls a nanoflow to validate the input entered by user and logs him in. Both the login page and the on-click nanoflow have only 'Anonymous' user role access. I run the application, enter valid credentials and log in successfully. After logging in, I pressed the browser's Back button, and it takes me to the login page again. I click on Login button again (my credentials are already pre-filled) - it gives me runtime error as below: The expected behavior is that upon clicking the back button on the browser (any number of times), the user should never be able to go back to login page since upon login he is assigned a new user role and login page has only 'Anonymous' role access. The app shows a system text in a popup with a System text saying "The page you requested was not found. You are being re-directed to the home page". I am seeing the issue only in QA or DEV (cloud environments) and unable to replicate it in local. In local it is working as expected.  
asked
2 answers
0

Hi Chethana,

 

did you recently update the mendix version of your application? I had this message when I upgraded and needed to refresh my cache. 

Otherwise have a look at the application log or the console log of the browser when this happens.

answered
0

As a workaround, you can try the followings:

When the page opens, check whether the user is already authenticated (for example with a nanoflow using getCurrentUser). If the user is logged in, immediately redirect them to the home page. This way, even if the user navigates back using the browser’s Back button, they will be automatically sent to the home page and won’t be able to interact with the login page again.

answered