-
Notifications
You must be signed in to change notification settings - Fork 166
Re-add authenticable salt method #2260
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,13 @@ def password=(new_password) | |
| write_legacy_password_attributes(digest) | ||
| end | ||
|
|
||
| def authenticatable_salt | ||
| return if encrypted_password_digest.blank? | ||
| Encryption::PasswordVerifier::PasswordDigest.parse_from_string( | ||
| encrypted_password_digest | ||
| ).password_salt | ||
| end | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a comment saying this is a Devise method required for authentication that we are overriding and that should not be removed as long as we need to override it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| private | ||
|
|
||
| def write_legacy_password_attributes(digest) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to return here. There are probably some users who don't yet have an
encrypted_password_digest, right? If those users sign in with RC 59, which usespassword_saltas theauthenticatable_salt, and then they hit RC 60, the salt will be different and their session will be dropped.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not users who don't have an encrypted password digest. Those have been backfilled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather, there should not be users who have an encrypted password but not an encrypted password digest.