Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "this wasn't me" functionality to password reset process #22705

Open
wants to merge 12 commits into
base: 5.x-dev
Choose a base branch
from

Conversation

mneudert
Copy link
Member

@mneudert mneudert commented Oct 22, 2024

Description:

Extends the password reset process with a "this wasn't me" functionality.

A new link was added to the (reworded) password reset email, allowing a user to invalidate the reset token without changing the user's password.

To support replacing the "reset password process cancelled" view, the event Template.loginCancelResetPasswordContent can be listened to. Writing any content to this event's variable will display that instead of the default content.

To prepare future auditing capabilities, the reset process has received the events for the three potential steps:

  • Login.resetPassword.initiated
  • Login.resetPassword.cancelled
  • Login.resetPassword.confirmed

fixes #14543

Refs DEV-14582

Review

@mneudert mneudert added c: Security For issues that make Matomo more secure. Please report issues through HackerOne and not in Github. Needs Review PRs that need a code review labels Oct 22, 2024
@mneudert mneudert added this to the 5.2.0 milestone Oct 22, 2024
@mneudert mneudert requested a review from a team October 22, 2024 19:23
caddoo
caddoo previously approved these changes Oct 23, 2024
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a couple of suggestions for possible improvements. Functional testing worked fine, though.

plugins/Login/lang/en.json Outdated Show resolved Hide resolved
plugins/Login/tests/UI/ResetPassword_spec.js Show resolved Hide resolved
plugins/Login/tests/Integration/PasswordResetterTest.php Outdated Show resolved Hide resolved
plugins/Login/lang/en.json Show resolved Hide resolved
plugins/Login/PasswordResetter.php Outdated Show resolved Hide resolved
plugins/Login/PasswordResetter.php Outdated Show resolved Hide resolved
plugins/Login/lang/en.json Outdated Show resolved Hide resolved
plugins/Login/lang/en.json Outdated Show resolved Hide resolved
*
* @param string $cancelResetPasswordContent The content to render.
*/
Piwik::postEvent('Template.loginCancelResetPasswordContent', [&$cancelResetPasswordContent]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event could also be posted directly in the template within a {{ set }} or similar. Might be a bit less complex, as you can directly see in the template where the data is coming from. On the other side is the comment here above useful and we couldn't add it similarly in the template. So guess I would keep it that way.

plugins/Login/Emails/PasswordResetEmail.php Show resolved Hide resolved
Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing left. Everything else now looks good to me.

plugins/Login/lang/en.json Outdated Show resolved Hide resolved
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Security For issues that make Matomo more secure. Please report issues through HackerOne and not in Github. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'This wasn't me' to reset password E-Mail
3 participants