Hi all,
We're working on a site and it's set up with a login system using the Login snippet. The login is specifically for one context, and this context has links pointing to the other context.
Everything works fine aside from links generated dynamically that are pointing to another context when the user is logged in. (i.e. [[~54]])
The cross-context links work fine when no one is logged in, but as soon as someone is logged in, the links change from being correct to the homepage of the current context.
--For example: before someone is logged in, the link displays correctly as "www.website.com/link", however once someone logs in, it changes to "new.website.com", which is the homepage for the current context.
I have tried making it [[~54? &scheme=`full`]], as well as messing with some of the context settings to no avail. This is using Revo 2.1.3-traditional and Login 1.7.0.
Thanks in advance for any help!
-
☆ A M B ☆
- 3,141 Posts
Weird thought - can you change any Wayfinder calls in the template from [[Wayfinder to [[-Wayfinder and see if your links work properly after that? Do you have any Wayfinder calls that are supposed to display a list of links in the other context, perhaps only visible when users are logged in?
Security comes to mind too. Is your second context protected? What ACLs are you in use for that one? What's your Login call look like?
I don't think those comment tags [[- will work in 2.1.3 but you could just add a space in between [ [ to have modx skip parsing that snippet.
I'm thinking security is an issue here too, ensure that your 'logged in' user group has access to each context for Load, List and View permissions and Member-9999 role to begin with
-
☆ A M B ☆
- 3,141 Posts
The comment tag may not actually work like it would in 2.2, but it will make the parses look for a -Wayfinder snippet, which it can't find, so it silently doesn't parse it.
If you add those permissions to every context for just that group, the anonymous (not logged in users) wont be able to access them so I don't think that's the best piece of advice to give.. that said - if the anonymous users have that assigned right now, that would explain why members can't get in.
-
MODX Staff
- 10,725 Posts
FWIW, the comment tag is in 2.1.5 and I encourage all 2.1.x users to upgrade to 2.1.5.
Do you have &contexts=`web,myothercontext` in your Login snippet tag? Without that, the user will only be logged in to the current context and the other context may not exist.
Also, make sure the base href tag in your template is called uncached.
Hey all, we managed to fix it but in a somewhat roundabout way. We're still not sure exactly what caused the problem, but to clear a few things up: we were not using Wayfinder in this case, they were just dynamic links. I tried changing it so the users would have logged-in context access in the ways suggested and none of the suggestions worked.
Either way, we ended up implementing a Facebook-Login integration using OpenGraph that Salscode developed/modified, and however he did it ended up fixing the problem. If there is any interest he said he would release the snippet as a package. It works very well so that's a plus.
Thanks for the suggestions everyone!