xfrocks
Well-known member
Steps:
Actual result: Went to index page
XenForo version: 1.3.0
Problem was with this snippet of code
The entire session data is cleared in XenForo_Session::changeUserId therefore the stored loginRedirect is gone before the call to retrieve it. In XenForo_ControllerPublic_Register:actionTwitter, the redirect target is retrieve before calling changeUserId, I believe we should do the same in XenForo_ControllerPublic_Register:actionFacebook to redirect user to the right page.
- Go to read some thread
- Click Facebook Login button on login bar
- Login with Facebook, allow/approve all permissions
- Associate account as needed
Actual result: Went to index page
XenForo version: 1.3.0
Problem was with this snippet of code
PHP:
class XenForo_ControllerPublic_Register extends XenForo_ControllerPublic_Abstract
{
...
public function actionFacebook()
{
...
if ($fbAssoc && $userModel->getUserById($fbAssoc['user_id']))
{
...
XenForo_Application::getSession()->changeUserId($fbAssoc['user_id']);
XenForo_Visitor::setup($fbAssoc['user_id']);
$this->_getUserModel()->setUserRememberCookie($fbAssoc['user_id']);
$redirect = XenForo_Application::getSession()->get('loginRedirect');
XenForo_Application::getSession()->remove('loginRedirect');
if (!$redirect)
{
$redirect = $this->getDynamicRedirect(false, false);
}
...
}
...
}
...
}
The entire session data is cleared in XenForo_Session::changeUserId therefore the stored loginRedirect is gone before the call to retrieve it. In XenForo_ControllerPublic_Register:actionTwitter, the redirect target is retrieve before calling changeUserId, I believe we should do the same in XenForo_ControllerPublic_Register:actionFacebook to redirect user to the right page.