Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
Changes default hashing algorithm fromBcrypt
toArgon2
in order to avoid problems with passwords with too many bytes. More about this issue can be found here. I also removed support for salt in User model, becauseArgon2
similarly toBcrypt
, stores the salt in the password hash.Changes minimum password length to 10.TurboController
andTurboFailureApp
classes are a part of it.Hashing with Argon2 was implemented with help of these 2 following gems:devise-encryptabledevise-argon2Edit: After talking with Rafał I was made aware of the fact that I shouldn't use
devise-argon2
library, because it usesArgon2
hashing algorithms in an invalid way. Instead I decided to simply add a validation to User model that checks if thebytesize
of password is not too long (Bcrypt will truncate any data after consuming 72 bytes, leading to potential problems).