• Resolved Sandip Patil

    (@sandipp)


    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);
    wp_set_auth_cookie($user_id);
    do_action('wp_login', $email);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    Thread Starter Sandip Patil

    (@sandipp)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to login without password’ is closed to new replies.