[resolved] How to login without password (3 posts)

  1. Sandip Patil
    Posted 3 years ago #

    Add below function for functions.php and pass parameter email :

    function login_user($email){
    $user = $this->get_user_info_by_login($email);
    $user_id = $user->ID;
    wp_set_current_user($user_id, $email);
    do_action('wp_login', $email);
  2. s_ha_dum
    Posted 3 years ago #

    In what context are you using this? If that works and if it is in any way public facing, it isn't very secure. Anyone who can guess or find your email can login.

  3. Sandip Patil
    Posted 3 years ago #

    In my case.. If user comes from social login.. that time if user already validated with social provider then i validate email existence in WP user table and then only allow to Login if it exist.

Topic Closed

This topic has been closed to new replies.

About this Topic