-
Notifications
You must be signed in to change notification settings - Fork 30
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
FIX Don't use the deprecated 'none' encryptor #272
FIX Don't use the deprecated 'none' encryptor #272
Conversation
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.
You'll need to run this one across sink .. there may actually be a reason we don't know about
Sink seems excessive, I'd have thought installer maybe. But to avoid ping pong I'll just do it with all of sink. Link to CI run will be in the linked issue description. |
// make sure any validation for password is skipped, since we're not testing complexity here | ||
$validator = Member::password_validator(); | ||
Member::set_password_validator(null); | ||
$nullValidator = new PasswordValidator(); | ||
$nullValidator->setMinLength(0); | ||
$nullValidator->setMinTestScore(0); | ||
$nullValidator->setHistoricCount(0); | ||
Member::set_password_validator($nullValidator); |
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.
Without this change, we get this error:
You've already used that password in the past, please choose a new password
The comment makes it clear this was the intention here.
Outside of testing I can't see any reason to not have a member password validator, and the current behaviour is when null
is passed in the result is the default password validator is instantiated which IMO is good behaviour.
$member->FirstName = $identifier; | ||
$member->Surname = "User"; | ||
$member->Email = $email; | ||
$member->PasswordEncryption = "none"; |
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.
This is the main change for this PR - anything else is done to support this change.
Setting a Member's
PasswordEncryption
to "none" ends up using the deprecatedPasswordEncryptor_None
class.There's no reason to not use encryption here.
Issue
PasswordEncryptor_None
when creating new users #271