wp_signon doesn't give error with wrong password (3 posts)

  1. matlin
    Posted 4 years ago #

    I am running the following code but get correct login regardless of what password I use. How can I get this to work?

    $creds = array();
    $creds['user_login'] = $username;
    $creds['user_password'] = $password;
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
    if (is_wp_error($user))

    header('HTTP/1.0 401 Unauthorized');


  2. kmessinger
    Forum Moderator
    Posted 4 years ago #

    Why are you not using wp-login.php?

  3. matlin
    Posted 4 years ago #

    I want to check the credentials programatically in one place. Otherwise I am using wp-login.php to login.

Topic Closed

This topic has been closed to new replies.

About this Topic