function user_login_destination

Helper function to rewrite the destination to avoid redirecting to login page after login.

Third-party authentication modules may use this function to determine the proper destination after a user has been properly logged in.

File

drupal/core/modules/user/user.module, line 2446
Enables the user registration and login system.

Code

function user_login_destination() {
  $destination = drupal_get_destination();

  // Modules may provide login pages under the "user/login/" path prefix.
  if (preg_match('@^user/login(/.*|)$@', $destination['destination'])) {
    $destination['destination'] = 'user';
  }
  return $destination;
}