Topic-icon Restricted Content or page for register user

Support Specialist
12 years 1 month ago #43755 by alzander
Try doing:
$returnUrl = $uri->toString(array('path', 'query')); 
echo $returnUrl;
exit;
That will display what the URL is that JFBConnect 'thinks' it should be redirecting too. See if that seems correct for the page that's being loaded or not.

Also, try setting the $returnUrl to a known-good URL to see if that redirection properly works and it's just the auto-generated one. That will help us narrow things down. To set it, just do:
$returnUrl = 'index.php';
That should be good enough, but you can obviously try any URL.

Let us know how that goes, and good luck.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 1 month ago #43756 by farkab
Ok I used base64_encode before return parameter .. Now redireting is working fine.. What do you think this is the perfect way to do that ?...Below is the code
JFactory::getApplication()->redirect('index.php?option=com_jfbconnect&task=authenticate.login&provider=facebook&return='.base64_encode($returnUrl)).'&'.JSession::getFormToken().'=1';
The topic has been locked.
Support Specialist
12 years 1 month ago #43763 by alzander
Your code there is closing the call too early. There shouldn't be 2 )) in the middle. Update it like:
JFactory::getApplication()->redirect('index.php?option=com_jfbconnect&task=authenticate.login&provider=facebook&return='.base64_encode($returnUrl).'&'.JSession::getFormToken().'=1');
I completely forgot about the base64_encode. Great catch!

That code above should get you what you're looking for. Sorry for the back and forth, and glad you're making progress!

Thanks,
Alex
The topic has been locked.