How to redirect particular page after login via social networking site? In my Drupal site I have placed a link in checkout page which takes to user/login. On successful login it redirects back to checkout page. For this I have used ?destination=checkout in the url. I have achieved using form alter

function module_form_commerce_checkout_form_checkout_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['checkout_message']['#markup'] = t('&lt;a href="/user/login?destination=/checkout"&gt;Click to login&lt;/a&gt;');
}


This redirects to login page and then redirects back to checkout page, till now it works fine. I have social site login in my login page (for eg., facebook, twitter, google).

How can I redirect the user to checkout if he/she login via social sites? FYI: Above is not working for social network login.

These are the modules used for performing a social login:


Facebook: Facebook OAuth.
Twitter, Google+: HybridAuth Social Login.
You can use user_login_destination() for your requirement which third-party authentication modules may use to determine the proper destination after a user has been properly logged in.

function user_login_destination() {
  $destination = drupal_get_destination();
  if ($destination['destination'] == 'user/login') {
    $destination['destination'] = 'user';
  }
  return $destination;
}


You just need to change line 4 to:

$destination['destination'] = '&lt;path you want to go to after login&gt;';