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

(BUG?) Password reset statistics #3509

Closed
sowinski opened this issue Nov 3, 2023 · 4 comments
Closed

(BUG?) Password reset statistics #3509

sowinski opened this issue Nov 3, 2023 · 4 comments

Comments

@sowinski
Copy link

sowinski commented Nov 3, 2023

Hi,

I want to log how many password reset emails are send per day.
(Because I guess there are some bots sending password resets all the time, but I am not sure).

  1. Is there somewhere some informations saved on a password reset in the database?
  2. If not, where would be the best place to implement my own code?
  3. Not sure if this is a bug or a feature but if you enter a non registered address then the system is also sending an e-mail. Why? Can I turn this of?
@pennersr
Copy link
Owner

pennersr commented Nov 3, 2023

Password resets trigger calls to one of:

  • get_adapter().send_mail("account/email/unknown_account", email, context)
  • get_adapter().send_mail("account/email/password_reset_key", email, context)

So, you could override the adapter send_mail() method and check the template name...

@pennersr pennersr closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
@pennersr
Copy link
Owner

pennersr commented Nov 3, 2023

  1. No
  2. See above
  3. Good UX.

If you're worried about sending too many of these mails, the password reset view is rate limited. You might want to tighten the rate limits.

@sowinski
Copy link
Author

sowinski commented Nov 29, 2023

Is it possible to disable this feature? It might be good UX but it is in Europe against GDPR laws.

It would be nice, if we could disable this in the settings.

If it is not possible, where would you disable this at all for non registered users? ALso in the send_mail() method?

EDIT: I ended up with this:

    def send_mail(self, template_prefix, email, context):
        if template_prefix == "account/email/unknown_account":
            return

        super(MyDefaultAccountAdapter, self).send_mail(template_prefix, email, context)

@pennersr
Copy link
Owner

but it is in Europe against GDPR laws.

IANAL, but I doubt this to be true. I can signup on any EU site using your email address, and all those sites will all send you an unsolicited (confirmation) email, and you cannot prevent this.

So yes, you can trick a system into sending an email to somebody that did not ask for it. How are you going to prevent that?

Having said that, given that people feel strongly about this there is some work ongoing in this area here: #3528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants