Make WordPress Core

Opened 20 months ago

Last modified 20 months ago

#57089 new enhancement

Automatically log-in a user

Reported by: ratkosolaja's profile ratkosolaja Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Users Keywords:
Focuses: Cc:



At the moment, when a user successfully resets their password they are presented with a screen prompting them to go to log in page and log in.

Automatically log in the user after successful password reset and redirect them to:

  • Site home page - if they aren’t an admin.
  • Site Dashboard (wp-admin) if they are an admin.

If we would like to give site owners an option, maybe we could have a toggle (checkbox) under Settings -> General that would control this - meaning, toggle between current option and proposed one.

Basic gist would be to remove the following lines of code inside wp-login.php file:


login_header( __( 'Password Reset' ), '<p class="message reset-pass">' . __( 'Your password has been reset.' ) . ' <a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log in' ) . '</a></p>' );

and replace it with something like:


wp_set_current_user( $user->ID );
wp_set_auth_cookie( $user->ID );

wp_safe_redirect( apply_filters( 'password_reset_redirect', esc_url( home_url( '/' ) ) ) );

Change History (1)

This ticket was mentioned in Slack in #core by ratkosolaja. View the logs.

20 months ago

Note: See TracTickets for help on using tickets.