Security Provider Enforcer: Redirect after Login to reffering url

Hi,
I have the following scenario where I am struggling with step 3:

  1. I send an email to a user that includes a link:mywebsite.com/secure_page.php?image=3
  2. Once the user goes to the page, he is redirected to the login page (I am successfully using the Security Provider Enforcer for this)
  3. I want the user to be redirected after login to the initial page he was visiting i.e. /secure_page.php?image=3

How can I do step 3?

Hi @Elias,

See this and maybe that might help you. It helped me.

1 Like

Many thanks @scott, indeed, that is exactly the same request.
However I am affraid the solution does not work for my case as I have pages under different folders and I can not pass under return variable=folder/securepage1.php

@Elias,

Have you tried using routing?

1 Like

Yes I have used it for SPA. I might use it here as well then, good idea

Thanks loads @scott for your suggestions, they worked great.
The only part that I am still struggling with is when I have a secured Single Page App (SPA) and I want to be able to forward the user to the right route within the SPA after login.
The challenge is that the login url is set at the SPA level, not at the individual route level, any ideas on how to overcome this?