Hi!
Problem/Motivation
User can't log in via one-time link that contains a "/login" suffix in the end.
Proposed resolution
I detected the problem that I can't log in via an one-time link (drush generated) after update of the Drupal core. After each attempt of login I'm redirected to a "user/password" page with a message "You have tried to use a one-time login link that has either been used or is no longer valid." I made an investigation and found that the problem is in Login Destination module - in "<current>" placeholder.
The Drupal 7.50 release contains an update in the login logic - #889772: Following a password reset link while logged in leaves users unable to change their password. This issue is a reason of the bug - so I think it's important to fix this bug at the Login Destination side.
Preconditions:
- Drupal 7.50
- Login Destination module 7.x-1.x
- a simple Login Destination rule should be added:
- DESTINATION: "<current>"
- TRIGGERS: "Login"
- PAGES: "All pages"
- ROLES: "All roles"
- ENABLED: True
Let me try to explain what is a nature of the bug:
- user uses one-time link
- Drupal authenticate the user
- Login Destination module set a current one-time link path as a 'destination' parameter via hook_user_login()
- user goes again to the path that equal to an one-time link via drupaL_goto()
- an updated core of Drupal logout the user and redirects again to the one-time link page
- Drupal tries to authenticate the user but the one-link is already expired
- user is redirected to the "user/password" page
In my opinion a "<current>" placeholder should be updated: it shouldn't return a current path for the "one-time login" menu callback.
The patch will be attached.
Comment | File | Size | Author |
---|---|---|---|
#3 | login_destination_current_placeholder-2776655-2.patch | 452 bytes | Chalk |
Comments
Comment #2
Chalk CreditAttribution: Chalk at DrupalSquad commentedComment #3
Chalk CreditAttribution: Chalk at DrupalSquad commentedPatch is here. Please, review it.
Comment #4
Chalk CreditAttribution: Chalk at DrupalSquad commentedComment #5
jastraat CreditAttribution: jastraat at Technivant commentedThis fixed our issue with drush uli as well.
Comment #6
Chalk CreditAttribution: Chalk at DrupalSquad commentedComment #7
EternalLight CreditAttribution: EternalLight as a volunteer commentedThe patch is actually working. That's amazing! Thank you, Chalk!
Comment #8
ddrozdik CreditAttribution: ddrozdik as a volunteer and at FFW, Drupal Ukraine Community for FFW commentedComment #10
ddrozdik CreditAttribution: ddrozdik as a volunteer and at FFW, Drupal Ukraine Community for FFW commentedThank you, committed to dev branch.