Reputation: 131
I am getting "http://example.com/user/reset/32/1530596529/g72Z2YhSpS8L5rWDXYKNCNoU1TRKF4GDGtnn2ictl0A"
when I click on it, "it converts to http://example.com/user/reset/32/" and I get a message saying "This login can be used only once."
I want to send direct hash link in email.
I have not used reset link but it says .
"You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below."
any help would be great.
Upvotes: 0
Views: 2300
Reputation: 326
This is a bit of an older issue, but is called often I see. I also had a similar issue, the problem is with the crawlers pre-scanning the link. This invalidates the link. We have created a module that prevents exactly that. Test, review and feedback are welcome.
https://www.drupal.org/project/shy_one_time
Upvotes: 0
Reputation: 31
You might have generated a link using something like
$account = \Drupal::entityTypeManager()->getStorage('user')->load(32);
$link = user_pass_reset_url($account);
And what you are telling seems like a normal bahavior because, yes, when you click a link it:
Alternatively, you may want to run
drush -vy uli --name="John.Doe" /user
This will generate you a link to log in immediately. You may specify a path where to redirect the user after logging them in. Check out the details here - https://drushcommands.com/drush-9x/user/user:login/
Upvotes: 2