We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Addons, Members

Member Redirect

Hello,

I have a members section I have set it up so when a user is logged out and being redirected to the login page I'm passing the page they requested into a query string, this is working well.

However I have a page that is protected in settings to a user with a certain tag, I can't seem to work out how to control the redirect for this. I assume it automatically redirects to the setting Login page path, any way I can do this dynamically?

I could just check for the tag manually on the page but I'm using perch navigation which doesn't show the page if the user doesn't have access.

Any way round this?

Dexter Harrison

Dexter Harrison 29 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the scenario you're trying to account for when a user session times out?

No sorry its when a user tries to visit a page that is members only when the user is not logged in gets redirected to the login page with a query string of the page the tried to visit.

So when they visit /this-is-one/of-my-pages

Get's redirected to /login?p={urlencoded-above-uri}

Then I'm passing that into the form.

That all works absolutely fine. But if I was to apply a member tag to the page I don't control the redirect, Perch does it automatically.

Hopefully i made that make sense.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, yes. If you add the tag to the page it won't be in the navigation, so they won't get the link.

And there is no way to tell Perch that you want to add the page to the query string during the redirect I'm guessing?

Drew McLellan

Drew McLellan 2638 points
Perch Support

When would it do this? The page isn't linked to.

Well I assume when you add a tag to page Perch does a look to check whether the page has a tag it can only be accessed with and whether the logged in member has that tag, then it does a redirect to whatever page you have set to the login page within settings.

At this point could a setting be added within Perch be added so when Perch does the auto redirect to append the requested uri to a query string?

Drew McLellan

Drew McLellan 2638 points
Perch Support

That doesn't exist, no.