Return a boolean of whether the raw password matches the three part encoded digest. If setter is specified, it'll be called when you need to regenerate the password.
(password, encoded, setter=None, preferred="default")
| 73 | |
| 74 | |
| 75 | def check_password(password, encoded, setter=None, preferred="default"): |
| 76 | """ |
| 77 | Return a boolean of whether the raw password matches the three part encoded |
| 78 | digest. |
| 79 | |
| 80 | If setter is specified, it'll be called when you need to regenerate the |
| 81 | password. |
| 82 | """ |
| 83 | is_correct, must_update = verify_password(password, encoded, preferred=preferred) |
| 84 | if setter and is_correct and must_update: |
| 85 | setter(password) |
| 86 | return is_correct |
| 87 | |
| 88 | |
| 89 | async def acheck_password(password, encoded, setter=None, preferred="default"): |