I'm building a new web site. I'm now writing the code where a user can request an email to reset a lost password. As I'm writing it, it occurs to me that there could be several scenarios:
- The user simply forgot their password and needs a reset, so it doesn't matter if I let the old password be valid.
- A hacker got into the user's email account and has requested a password reset from my site, so it's best to leave the old password valid for a few days so the user can get back into the account and alert a mod.
- The user's password is compromised and needs it changed immediately, so letting the old password be valid risks letting unauthorized persons into the account.
What is the solution to this dilemma?