Skip to content

Commit

Permalink
Provide Member's unique_identifier_field to the password validator (#165
Browse files Browse the repository at this point in the history
)
  • Loading branch information
elliot-sawyer authored and Nathan committed Dec 17, 2019
1 parent d3ccf35 commit 569515c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Forms/MemberProfileValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ public function php($data)
if (isset($data['Password']) && $data['Password'] !== "") {
if (is_null($member)) {
$member = Member::create();

//pass in the Unique Identifier Field (usually Email)
$idField = Member::config()->get('unique_identifier_field');
if(isset($data[$idField])) {
$member->$idField = $data[$idField];
}
}

if ($validator = $member::password_validator()) {
Expand Down

0 comments on commit 569515c

Please sign in to comment.