When you have peLoginMode set to Required, everything is fine. also, all our samples uses that approach. Would be nice to have at least one of them using peLoginSupported, so we could reference some code when trying to implement it..


I am facing some challenges to make a login webview to work in a mobile app with loginsupported scenario. I started this discussion before here, and I thought I got everything working.. but just discovered now it does not fully works in my case.

Requirements:
  • User is allowed to access several "open" webviews, and may choose to login at any-time. (Ie. the "current" view could be anyone) ;

So, using navigateForward does not seem the right approach, as I would have to register the loginview on every/all views in the app. (not willing to to that)

  • the mobile 19.1 template, uses a new approach by using the stateHash, and NavigateBegin to "solve" that. but this is bringing other challenges:



  • After the login view is closed, user must get back to where it was ; with new options applied, if it has the privileges of course;

This is working partially fine. It works ok for the 1st time the loginview is opened. the correct "previous" (viewA for example) view is shown properly after the 1st successful login.
But if the user logs-out, and navigates to other views, let's say ViewB now, and tries to login again, it goes back to the viewA again.



  • The login view may be "Canceled" ;

I would like to give the user an option to "give-up" and just get back to where it was. This is where I am facing issue. The login template for 19.1 webmobile has no such feature, as it's designed to work in "loginRequired" mode.
As it's activated using NavigateBegin, the state-hash is overwritten, and no Browser "Back" button is available for this option as well. Back button becomes disabled.
I tried to use the same approach from the template, using NavigateToStateHash in this case as well , but again it only works for the 1st time.
It goes back to the wrong "previous" view if the user opens the login page multiple times , coming from different places.
(viewA -> login, Cancel, get's back to "viewA" ok.
Navigate to other different views, ask to login again, cancel or successful login, it goes back to "viewA" again.

I can see that the current statehash is saved during the OnLoad in the login.wo webview, and if we do the same using OnShow instead, this should be "fixed". But this all seems to much complicated approach. It seems we need to "hack" the navigatino mechanims to make logins work properly in a "LoginSupported" mode.. Shouldn't all of this be easier to implement ?

Could this be reviewed, and please have this scenario implemented in one of the Samples workspaces, instead of just loginrequired?
Or at least a pretty and complete sample in the help as well on how to handle all of these details,,, when using loginSupported .

Appreciate any valuable inputs..

Regards