#32030 closed New feature (duplicate)
Make Token Generator more universal — at Version 5
| Reported by: | Ilya Chichak | Owned by: | Ilya Chichak |
|---|---|---|---|
| Component: | contrib.auth | Version: | 3.1 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I suggest to split current PasswordResetTokenGenerator into BaseTokenGenerator and it's implementation PasswordResetTokenGenerator
To make BaseTokenGenerator more universal, it should contain class variable TOKEN_TIMEOUT with token timeout and _make_hash_value method public and abstract.
It will make possible to make email confirmation tokens, one time enter tokens and other with reimplementing make_hash_value method and setting separate timeout for each token generator. Current PasswordResetTokenGenerator will be implementation of BaseTokenGenerator where TOKEN_TIMEOUT will be settings.PASSWORD_RESET_TIMEOUT. So, for all logic, that uses PasswordResetTokenGenerator nothing will be changed.
Change History (5)
comment:1 by , 5 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 5 years ago
comment:3 by , 5 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | assigned → closed |
comment:4 by , 5 years ago
@felixxm
In ticket you provided you said PasswordResetTokenGenerator is not universal.
So, I made BaseTokenGenerator that is more universal and flexible and not breaking current code.
Can I hear alternative opinion?
comment:5 by , 5 years ago
| Description: | modified (diff) |
|---|---|
| Has patch: | set |
Duplicate of #30423.