I manage to do it by calling to
in every single site except for /login.xhtml. It seems that adding it to the link is too late, as the view is already /login.xhtml. Is there a cleaner way of achieving this behaviour? (I only want to save the current view if the user clicks the login button, not always except when the user is in the login screen...)
Why don't you just replace your links that go directly to the login page (/login.xhtml) with links to your default secure page? (e.g. /secure/index.xhtml)
the thing is that the page is not necessary secure. You can be logged, but you can also not be logged, but I still want the user to be able to login in that page, and then be returned to the page again.
Think of a final reservation process, where you can anonimously finish it, or still pressing a login button, so that anonimous login form disappears and you have your account information instead...
Thank you for replying!