VaultPress::authenticate PHP Method

authenticate() public method

public authenticate ( $user, $username, $password )
    function authenticate($user, $username, $password)
    {
        if (is_wp_error($user)) {
            return $user;
        }
        if (defined('XMLRPC_REQUEST') && XMLRPC_REQUEST || defined('APP_REQUEST') && APP_REQUEST) {
            // Try to log in with the username and password.
        }
        $retval = $user;
        if (empty($_POST['_vptrue']) || !in_array($_POST['_vptrue'], $this->get_login_tokens(), true)) {
            $retval = new WP_Error('invalid_token', __('Invalid token. Please try to log in again.'));
        }
        return $retval;
    }
VaultPress