April 8, 2015 at 4:13 pm #12470DorinMember
Hi, Is there a possibility to redirect the user after the login to the previous page?
For example, the user access a protected page and the message to login appear. The user then hit the login button, successful login and then the redirect page should be the protected page from where he hit the login button.
Is this possible?
Thank you.April 8, 2015 at 4:28 pm #69509wzpModerator
Have you tried using the popup login? When you use that option, the user can log in while staying on that page:June 28, 2017 at 1:53 am #69510
Hi, I’m wondering if this redirect is possible if we don’t use the popup login. We have a situation where we are using a plugin for a directory and to submit a listing to the directory, will require login. So the configuration in the directory plugin need the actual login page URL to get member to login first. However, after login, it doesn’t redirect back to the directory page even though it is set in the URL to redirect. I have already removed the redirect page in eMember settings which I thought was overriding the URL redirect to the directory page.
Is this something that can be done? Thanks.June 28, 2017 at 2:09 am #69511
The following documentation explains all the redirect options available in the plugin:
There is an “inline login” option which lets you stay on the page after the login (even though you have configured after login redirection). Check that option to see if that works for you.
There is also a way to override the after login redirect by adding a query parameter to the URL. Useful if you are linking to a protected page and want the user to stay on that page after the login. The following post has explanation on how to do that:June 28, 2017 at 2:24 am #69512
Thanks for your suggestion. Unfortunately I’m not sure how I can use the inline login as the directory plugin asks for a URL to the login page. And when public click on the button in the directory, it will go to the login page. It is not quite a protected page. More like the directory detects that there’s no login, so will go to the login page that has been specified in the configuration. So it can’t be the inline login.
I also can’t protect the directory listing page as it should be visible to public. If I could, that would probably work to bring up the inline login.
I’ve had a look at the links above too. The first won’t work as it is not a static redirection. That worked ok to always redirect to the same page after login but not this situation. The second link with the URL is similar to what is required. The directory button actually put a redirect_to parameter after the login. But that redirect_to parameter doesn’t seem to take effect. That is the problem. Here’s the URL (with edited domain name).
Should that work or not?June 29, 2017 at 1:22 am #69513
We can add an option so our plugin redirects to the URL specified in the “redirect_to” query parameter after the login operation. Will that help?June 29, 2017 at 1:26 am #69514
If it’s not too difficult and will not affect how the other redirection in eMember works, that would be great! Otherwise, we can live with a workaround of getting members to login first before they are able to click on the submit listing. Thanks.June 30, 2017 at 1:46 am #69515
I had a look at the code and I think I should be able to add an option without upsetting any of the existing redirection. Give me a reminder if I forget about it.
- You must be logged in to reply to this topic.