Issue #889772 by stefan.r, tuutti, opdavies, Sutharsan, joachim, das-peter,...
Issue #889772 by stefan.r, tuutti, opdavies, Sutharsan, joachim, das-peter, YesCT, Zerdiox, hussainweb, mgifford: following a password reset link while logged in leaves users unable to change their password
@@ -93,7 +93,7 @@ public function resetPass($uid, $timestamp, $hash) {
if($account->isAuthenticated()){
// The current user is already logged in.
if($account->id()==$uid){
drupal_set_message($this->t('You are logged in as %user. <a href="@user_edit">Change your password.</a>',array('%user'=>$account->getUsername(),'@user_edit'=>$this->url('entity.user.edit_form',array('user'=>$account->id())))));
user_logout();
}
// A different user is already logged in on the computer.
else{
...
...
@@ -105,31 +105,31 @@ public function resetPass($uid, $timestamp, $hash) {
// Invalid one-time link specifies an unknown user.
drupal_set_message($this->t('The one-time login link you clicked is invalid.'));
}
return$this->redirect('<front>');
}
return$this->redirect('<front>');
}
else{
// The current user is not logged in, so check the parameters.
drupal_set_message($this->t('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.'));
return$this->redirect('user.pass');
}
// The current user is not logged in, so check the parameters.
drupal_set_message($this->t('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.'));
return$this->redirect('user.pass');
}
}
// Blocked or invalid user ID, so deny access. The parameters will be in the