Support » Plugin: Ultimate Member - User Profile & Membership Plugin » Account Activation Email Link redirect is broken

  • My “Account Activation Email” are going out now for new users as expected when set to plain text mode (separate issue with HTML) and contain an activation link that looks like the following:

    http://<mydomain&gt;?act=activate_via_email&hash=<some hash>&user_id=50

    When I click on that link it, it takes me to my site, which I now see is correctly finding the user and hash and completing the step to

    $ultimatemember->user->approve();

    But it’s the redirect that comes right after that which is not working correctly, as I end up on a 404 page with URL http://<mydomain>/<mydomain&gt; (yes, duplicated, like http://example.com/example.com ).

    I have looked at the source code for UM to see that it’s getting where to redirect by calling

    um_user('url_email_activate')

    Debugging the code, I see that that value is <mydomain> or “example.com”.

    After completing the reset of the activation sequence, the function ends with a call to wp_redirect( $redirect ) . wp_redirect triggers a 302 response with the header value “Location” set to the value passed in, so in this case, I see in my browser that I’m receiving it in the format like:

    Location: example.com

    In this case, the browser must treat that as a relative URL, not an absolute URL, given that there is no HTTP:// at the front and therefore the browser is correctly interpretting this as a request to redirect to http://<mydomain>/<mydomain&gt;

    (see https://tools.ietf.org/html/rfc7231#section-7.1.2 “When it has the form of a relative reference…”).

    So my question is, why is Ultimate Member setting url_email_activate to my domain name? It would work fine if it were set to “http://<mydomain>” or if it were not set to anything (relative path redirect would still get me to my homepage). How can I change this behavior? I don’t see anything in any of the various setting options to control this.

Viewing 1 replies (of 1 total)
  • By the way, I validated that this is indeed the problem by updating the UM code to force the value of $redirect to “http://<mydomain>” rather than “<mydomain>” to see what hapens with the wp_redirect() in that case. This does redirect as expected back to my homepage after validation.

Viewing 1 replies (of 1 total)
  • The topic ‘Account Activation Email Link redirect is broken’ is closed to new replies.