After login, trying to navigate to two different pages based on a condition is not working

I have two views both of which have the setting “Allow page to be opened without authentication” turned off.

After successful login, I have the flow as below. Some how it is always going to ProdDetail (if cond = true) page irrespective of whether if cond resolves to true or false. The toast messages appear fine based on true/false output but the page navigation is not correct.

Can anyone suggest what I am missing?

Just checking again to see if anyone has any suggestions. Just want to make sure if it is possible at all and see if I need to redesign. Please suggest. thanks!

Put the logic in the page load event of the first page(not the initial view) rather than on the login button.
If(Condition) navigate to other page or stay on the same page,