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.

1 call to user_login_destination()
openid_login_form in drupal/core/modules/openid/openid.module
Form constructor for the OpenID login form.

File

drupal/core/modules/user/user.module, line 2935
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;
}