Review main Merged Breaking

75274[!!!][BUGFIX] Set password forgot hash based on user uid in ext:felogin

Torben Hansen CR +2 V +2 Hard +130 −161 updated 09/30/22, 08:02

Commit message

When the forgot password function is used, TYPO3 looks up the affected
frontend user record by either the email address or the username. If
a user record is found, the email address of that record is used to
set the password forgot hash. This may lead to the situation, that
the password forgot hash is set to multiple frontend user records
containing the same email address (e.g. in different storage PIDs).

With this change, the calculated password forgot hash is now saved
based on the frontend users uid.

Additionally, the sendRecoveryEmail function in RecoveryService has
been streamlined and simplified. The superfluous and wrong lookup
of the frontend user by the email address in RecoveryService has
been removed and the function signature of sendRecoveryEmail has
been changed to support an array of given userdata and a
pre-calculated password forgot hash.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Markus Klein +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 2

Files 8

Review log 3143

Show 1318 earlier messages
  1. Torben Hansen uploaded patch set 1 07/24/22, 13:20

  2. core-ci voted on patch set 1 V +1 07/24/22, 13:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29466

  3. Oliver Hader commented on patch set 1 07/25/22, 13:44

    RecoveryServiceInterface.php:22

    Can we ensure it was not used by user-land code in extensions - e.g. implementing their own RecoveryService, transmitting tokes via <random-technolog>™?
  4. Torben Hansen commented on patch set 1 07/25/22, 17:00

    RecoveryServiceInterface.php:22 Reply

    Thought about that situation too. At least no extension in TER implements the interface, but yes, users could have implemented the interface in custom, non public projects. IMO the current RecoveryService / sendRecoveryEmail function has too many dependencies and unexpected behavior, since the calculation of the hash and the update of the user record happens in sendRecoveryEmail. Would it be better to keep the Interface and change the function signature?
  5. Torben Hansen rebased onto patch set 2 07/26/22, 04:55

  6. core-ci voted on patch set 2 V +1 07/26/22, 05:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29539

  7. Torben Hansen uploaded patch set 3 08/01/22, 17:36

  8. Torben Hansen commented on patch set 3 08/01/22, 17:36

    RecoveryServiceInterface.php:22 Reply

    I now only changed the function signature and kept the interface.
  9. core-ci voted on patch set 3 V -1 08/01/22, 17:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29768

  10. Torben Hansen uploaded patch set 4 08/01/22, 17:57

  11. core-ci voted on patch set 4 V +1 08/01/22, 18:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29769

  12. Simon Schaufelberger commented on patch set 4 08/02/22, 07:59

    Breaking-95132-SetPasswordForgotHashBasedOnUserUidInExtfelogin.rst:24

    signature. don't you use a spell checker in the browser or saw the typo in phpstorm?
  13. Torben Hansen uploaded patch set 5 08/02/22, 08:18

  14. Torben Hansen commented on patch set 5 08/02/22, 08:19

    Breaking-95132-SetPasswordForgotHashBasedOnUserUidInExtfelogin.rst:24 Reply

    Missed that one. Done.
  15. core-ci voted on patch set 5 V +1 08/02/22, 08:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29773

  16. Simon Schaufelberger commented on patch set 5 08/02/22, 10:54

    RecoveryService.php:56

    since they don't add any useful information, they can be dropped.

    RecoveryServiceInterface.php:29

    since they don't add any useful information, they can be dropped.

    RecoveryServiceTest.php:63

    since they don't add any useful information, they can be dropped.

    RecoveryServiceTest.php:237

    since they don't add any useful information, they can be dropped.
  17. Torben Hansen commented on patch set 5 08/02/22, 16:22

    RecoveryService.php:56 Reply

    I prefer to remove all superfluous parameter and return type annotations in ext:felogin at once in a different commit. I will take care of that task in a different issue.

    RecoveryServiceInterface.php:29 Reply

    I prefer to remove all superfluous parameter and return type annotations in ext:felogin at once in a different commit. I will take care of that task in a different issue.

    RecoveryServiceTest.php:63 Reply

    I prefer to remove all superfluous parameter and return type annotations in ext:felogin at once in a different commit. I will take care of that task in a different issue.

    RecoveryServiceTest.php:237 Reply

    I prefer to remove all superfluous parameter and return type annotations in ext:felogin at once in a different commit. I will take care of that task in a different issue.
  18. Simon Schaufelberger commented on patch set 5 08/05/22, 09:15

    RecoveryService.php:56 Reply

    Ack

    RecoveryServiceInterface.php:29 Reply

    Ack

    RecoveryServiceTest.php:63 Reply

    Ack

    RecoveryServiceTest.php:237 Reply

    Ack
  1. Chris Müller uploaded patch set 6 08/08/22, 17:35

  2. core-ci voted on patch set 6 V +1 08/08/22, 17:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29960

  3. Torben Hansen uploaded patch set 7 08/17/22, 17:32

  4. core-ci voted on patch set 7 V +1 08/17/22, 17:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30247

  5. Torben Hansen rebased onto patch set 8 08/28/22, 12:34

  6. core-ci voted on patch set 8 V +1 08/28/22, 12:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30504

  7. Simon Schaufelberger wrote 08/28/22, 19:34

    Removed cc Simon Schaufelberger.
  8. Torben Hansen rebased onto patch set 9 09/24/22, 11:08

  9. core-ci voted on patch set 9 V +1 09/24/22, 11:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31500

  10. Oliver Hader voted on patch set 9 CR +1 09/26/22, 20:00

  11. Simon Schaufelberger voted on patch set 9 CR +1 09/27/22, 23:52

  12. Benni Mack commented on patch set 9 09/28/22, 11:49

    really, let's drop the RecoveryServiceInterface, which we now change. The interface is really useless, as it does not provide any benefit as is currently (implemented in EXT:felogin, cannot be overridden on a per-site basis or similar, but only via DI which can be done with the implementation class as well).
  13. Torben Hansen uploaded patch set 10 09/28/22, 13:53

  14. Torben Hansen rebased onto patch set 11 09/28/22, 13:54

  15. Torben Hansen updated the commit message in patch set 12 09/28/22, 13:56

  16. Torben Hansen commented on patch set 12 09/28/22, 13:56

    Reply

    Done
  17. Benni Mack voted on patch set 12 CR +1 09/28/22, 14:01

  18. core-ci voted on patch set 11 V +1 09/28/22, 14:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31660

  19. core-ci voted on patch set 10 V +1 09/28/22, 14:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31659

  20. core-ci voted on patch set 12 V +1 09/28/22, 14:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31661

  21. Benni Mack voted on patch set 12 V +1 09/29/22, 23:13

  22. Georg Ringer voted on patch set 12 V +1 CR +1 09/30/22, 05:37

  23. Markus Klein voted on patch set 12 CR +1 09/30/22, 06:56

  24. Benni Mack voted on patch set 12 V +2 CR +2 09/30/22, 08:02

  25. Benni Mack merged patch set 13 09/30/22, 08:02