• Resolved jmock

    (@jmock)


    Is it possible to fire off a password sync manually? Here’s what I’m trying to resolve:

    A customer purchases a product and we create an account for them behind the scenes with a random password using the email they purchased with. This appears to be what is syncing w/our other server.

    On the order receipt page after purchasing, the user is presented with a password & password confirm field where they set their own password (the code uses wp_set_password()). This password isn’t updating on the remote server. There are no errors in the log, but I get an incorrect password error on the remote site when I try to log in (I verified the account does exist).

    Is there a way for me to force a sync when the user sets their password?

Viewing 1 replies (of 1 total)
  • Plugin Author Alexandre Froger

    (@frogerme)

    Hi!

    I’ve just updated the plugin to support the upcoming WP 6.8 password hashing, and took the opportunity to rework how the passwords are handled in WPRUS.

    Below is a tested working snippet triggering the sync as intended, using the core WP actions, and that can be adapted to your specific needs:

    function wprus_pwd_test() {
    $user_id = 1234;
    $password = 'new_pwd';
    $user = get_user_by( 'ID', $user_id );
    wp_set_password( $password, $user_id );
    wp_update_user( $user );
    }
Viewing 1 replies (of 1 total)

The topic ‘Manually fire a password sync?’ is closed to new replies.