How to customize URL redirect in new devportal ?

Not applicable

Customer has set an Url Redirect to home page after login, so even after password reset it is going to home page, which is restricting them in setting up the new password. Is there any way to redirect to home page after Login EXCEPT when using one time login?

0 1 127
1 REPLY 1

If you want to redirect a user to the home page or another custom page after login, you can either use a module, or code a custom module to do this for you.

Login Destination is the most direct module, but LoginToboggan is another option that contains many other common login features such as letting the user login using an email address or username.

You can also create your own custom module that overrides the hook_user_login Drupal hook. This is how the Login Destination module does this:

/**
 * Implements hook_user_login
 */
function login_destination_user_login(&$edit, $account) {
    if (!isset($_POST['form_id']) || $_POST['form_id'] != 'user_pass_reset' || variable_get('login_destination_immediate_redirect', FALSE)) {
        login_destination_perform_redirect('login');
    }
}