Auto-activate affiliates on signup

I'm trying to automatically activate affiliates so they don't have to manually enable affiliate links on signup.

In this thread I found the below code snippet:

function custom_activate_afiliates() {
  $current_user = wp_get_current_user();
  $user_ID = $current_user->ID;
  if ( get_user_meta( $user_ID, 'enable_affiliate', true ) != 'yes' ) :
    update_user_meta($user_ID, 'enable_affiliate', 'yes' );
  endif;
}
add_action( 'wp', 'custom_activate_afiliates' );

This enables the affiliate links on signup, but the affiliate links aren't properly enabled. The affiliate URL shows as "?ref=" instead of "?ref=username-XXX". In order to fully enable the affiliate links users have to click "Update Settings" which defeats the purpose.

It seems like the above code snippet gets most of the way there and there's just a small error, but I can't figure out what it is. Any ideas?

Thanks!