|
|
|
|
|
by wulczer
4904 days ago
|
|
It's interesting how differently Django handles password resets - no nonce is generated. Instead, the user is emailed a token that's just her user ID, HMAC-signed with the last login date and a secret site key. You can't generate valid reset links without knowing the secret key and you can't tamper with the one you got because it's HMAC-signed. By adding the last login date to the HMAC you make sure the link can be used only once. After a user resets her password, the last login date is updated to now so the link is no longer valid due to broken HMAC. I like this solution because it doesn't rely on storing any state anywhere between requesting the reset and completing it. |
|