Skip to content

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.

1 participant