• Resolved IT Hertz

    (@it-hertz)


    All users are getting the invalid link error every time a reset attempt is made via the “Forgot your password?” link. I read this UM support page , so I’m familiar with the official suggestions; no joy.
    I’m not using a caching plugin, nor blocking cookies, and I’ve confirmed there are no conflicts with other plugins by deactivating all of them.

    I have contacted my host and after several back-and-forths, they aren’t proving to be very helpful. For one thing, they can’t or won’t tell me specifically whether they are caching UM’s pages or blocking UM’s cookies this year. I don’t have the ability to configure caching on their server, so I am at their mercy. All they have told me thus far is that they modified my .htaccess file and updated me to the latest PHP version in an attempt to resolve this issue. I cant imagine why they would now be blocking UM activity, since it’s the same host I’ve been using for years, and password reset was working perfectly last year.

    I’m still using {password_reset_link_v2}. Is there a newer one?

    My client is a small dance school and most users don’t login between seasons (starts in Sept.). Of those, probably few to none of them forgot their password, so this issue could have begun and gone unnoticed for nearly a year, for all I know. It seems that a UM update borked this. I just have no idea which update over the past year may be responsible.

    Is this a known issue with a specific update(s) over the past year? Should I fallback to a previous version and, if so, which one? I searched the support threads and only found one reference to the caching problem, and I think that person had been using a caching plugin, which I’m not doing.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support yuriinalivaiko

    (@yuriinalivaiko)

    Hello @it-hertz

    The password reset feature still uses cookies. This was not changed last year. You’ll see an error message if cookies are blocked or cached. There are different levels of caching: server, plugin, browser. You can’t disable server caching without your hosting provider’s help. You said that you are not using a caching plugin. Please verify that the browser caching is disabled. Usually this depends on the Cache-Control header. We recommend using these headers to be sure:

    • Cache-Control: no-cache, no-store, must-revalidate
    • Pragma: no-cache
    • Expires: 0

    There is no {password_reset_link_v2} email placeholder in the plugin. Existed email placeholders are listed in this article: https://docs.ultimatemember.com/article/1340-placeholders-for-email-templates. Did you add the {password_reset_link_v2} email placeholder using your custom code? The default email placeholder that generates a password reset link is {password_reset_link}.

    Regards

    Thread Starter IT Hertz

    (@it-hertz)

    ffs.. No wonder! There WAS a {password_reset_link_v2} last year when I was building this site, because UM advised us to use that in our email templates, in order to fix an issue with the link.
    Here’s a thread that proves it existed: https://www.ads-software.com/support/topic/password_reset_link-not-working-in-account-welcome-email/

    And this: Ultimate Member – Password Reset Link in Welcome Email · GitHub
    // Usage: Add this short tag to any Email Template in UM > Email settings: {password_reset_link_v2}
    /**
    * UM Placeholders for reset password
    *
    * @param $placeholders
    *
    * @return array
    */
    function um_121520_add_placeholder( $placeholders ) {
    $placeholders[] = '{password_reset_link_v2}';
    return $placeholders;
    }

    add_filter( 'um_template_tags_patterns_hook', 'um_121520_add_placeholder', 10, 1 );

    Evidently, I never got the memo or saw anywhere in UM docs that devs had renamed the fixed version back to {password_reset_link}. Much time wasted on this, but it’s working now that I removed “_v2” from the tag.

    Plugin Support yuriinalivaiko

    (@yuriinalivaiko)

    Let me clarify this question to avoid misunderstanding.

    The default email placeholder {password_reset_link} generates a password reset link in the “Password Reset Email“. This email placeholder can not be used in the “Account Welcome Email“.

    The Ultimate Member plugin never had the {password_reset_link_v2} email placeholder. I guess you used a custom code from this gist to add this custom email placeholder to your site to use it in the “Account Welcome Email“. This custom email placeholder relies on the custom code and does not work if this custom code is removed.

    Regards

    Thread Starter IT Hertz

    (@it-hertz)

    You’re splitting hairs. The UM plugin contributor(s) at that time, sporting the official orange tag and ostensibly working directly with the dev team, provided the fix for the non-functional reset link tag.
    For all intents and purposes, v2 could be considered officially an adjunct part of the plugin, since it made it functional. Without it, the reset password link simply was not working in the reset email template back then. Obviously, the plugin was changed later by UM, which killed v2 functionality, and so now the original tag name works instead.

    Unfortunately, despite the fact that it was the official plugin contributor(s) who recommended the v2 fix in the first place, UM saw fit to not bother including mention of this reversion to the original tag name sans “_v2” in the official support docs, instead sending users on a wild goose chase by asserting that the culprits are without doubt caching and/or cookie blockage. As it turns out, these have absolutely nothing to do with the problem where v2 is still being used. This is not even alluded to at all in any of the support pages I found. Either this was intentional, or whoever wrote up the support docs had no knowledge of the v2 cure. Sinister or incompetent.

    That one little sentence in the docs would have saved me hours and frustration in troubleshooting, even involving my host’s tech support personnel. UM should have alerted users to remove those 3 chars from their v2 email tag and password reset will probably work for them again. Hopefully, anyone else reading this thread will be spared that lost time and aggravation.

    I never used UM to send a welcome email. In fact, I disabled the welcome email because of how the school wanted the rest of the site to handle registration — I only use UM for the login, reset/change password, and role-based restrictions.
    I created a relatively complex CF7 form for simultaneously registering parents with the site, registering their kids with the school, placing tuition orders in WC, and sending out relevant emails to various parties, all with a single Submit button click.
    So, no, I did not use v2 in the welcome email template. I used it in the password reset email template. Like the GitHub code comment says, it was to be used in any email template. And that’s what UM users did back then, and that’s what made reset work. And no, I didn’t code any additional functions to go beyond v2, and yes, I used UM’s built-in template editor.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘always invalid key with password reset’ is closed to new replies.