× Joomla Facebook Connect support forum

Topic-icon Facebook Login Redirect

Active Subscriptions:

None
14 years 2 months ago #20901 by fb_100001852085900
Hi There,

This is a post regarding my previous post here: www.sourcecoast.com/forums/jfbconnect/jf...ebook-login-redirect . Could not see a way to add another post so i created a new one.

I have managed to find the issue to why the facebook login redirect did not work. What i was trying to achieve was to redirect a user to another url via the "return" variable and only redirect to my selected menu item if the "return" variable did not exist. However when logging in via the facebook icon it would only ever return to my selected menu item.

I made a small change to an ELSE IF statement in your "loginregister" model inside the method "getLoginRedirect". At the top of the method i added the following line of code to get the return url:
$return = JRequest::getVar('return', null, 'request', 'base64');

I then changed your ELSE IF statement from:
$configModel->getSetting('facebook_login_redirect_enable')

To:
$configModel->getSetting('facebook_login_redirect_enable') && ($return == null)

Making this change seemed to have solved the problem i was having. I'm not sure if this is a bug or if i was trying to make the component do something which it couldn't but im sure this would be a useful function for other users as the core joomla login allows the use of a return url as well.

Note: I made this change to the latest version of the component (4.1.2) so not sure if this would be the same for the other versions.
The topic has been locked.
Support Specialist
14 years 2 months ago #20925 by alzander
Replied by alzander on topic Facebook Login Redirect
Jon,
Thanks so much for getting back to us with your fix, and sorry I didn't respond back to the other thread. Old threads automatically close after about 45 days, which is why you couldn't post there. It helps some users from reviving long dead threads, which was way too common before.

As for your change, it looks spot on for what you mention. Thinking about it, I actually agree that that's probably the best behavior, as that return variable simply helps the user experience by getting the user back to where they wanted to be. I've added a note to our tracker for this change, and I can see it being in the upcoming 4.2 release as well.

Thanks again, and good luck!
Alex
The topic has been locked.