Umbraco version: 15.4.2
When using the public access feature of Umbraco to restrict access to pages, a Login page must be specified. When a user tries to view that protected page, the page’s content is replaced with the Login page content at the same URL, then replaced by the page content after a successful login. I would like the Login page to handle both this scenario, and cases where someone has arrived at the Login page without first trying to view protected content. In the latter case, I would like the page to automatically redirect to a given page, instead of redirecting to the same page, which in this case is the Login page.
We are currently using UmbLoginController.HandleLogin
to handle the Login request, and I know there is a redirect URL parameter which can be used for this, but at the moment I am unsure if it’s possible to determine if a given visitor has arrived at the Login page because they are trying to view protected content, in which case they should be sent to the same URL after logging in, or if they have arrived at the Login page independently, in which case they should be sent to a different URL.
Is it possible to determine whether a given user has arrived at the Login page after attempting to view protected content, and therefore not include a redirect URL? Or worded another way, is it possible to determine whether a given user has arrived at the Login page without first trying to view protected content, so we can include a redirect URL parameter in the login request?