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

Allow overriding _handle_long_passwords #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bliepp
Copy link

@bliepp bliepp commented Sep 25, 2022

This introduces an optional parameter for the generate_password_hash and check_password_hash member functions. It overrides the default set by BCRYPT_HANDLE_LONG_PASSWORDS. As mentioned in #45 it might introduce a bit more complexity, but there are reasonable use cases for this, e.g.:

  • If you did not allow long passwords in the past and want to transition to allowing it afterwards in your already deployed application.
  • If you want to support long passwords but want to reduce computational cost as most users don't use 72-byte passwords.

Both cases require the option to use both methods in the same application which was currently not possible (or at least not in a simple way as it required two instances of flask_bcrypt.Bcrypt() and manually overriding the "protected" _handle_long_passwords variable on one of those).

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

Successfully merging this pull request may close these issues.

None yet

1 participant