Skip to content

Commit

Permalink
FIX re-label forgot password for uniq id
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewandante committed Jan 20, 2025
1 parent 82f5310 commit c5843c9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Security/MemberAuthenticator/LostPasswordForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use SilverStripe\Forms\EmailField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\TextField;
use SilverStripe\Security\Member;

/**
* Class LostPasswordForm handles the requests for lost password form generation
Expand All @@ -23,8 +25,15 @@ class LostPasswordForm extends MemberLoginForm
*/
public function getFormFields()
{
$uniqueIdentifier = Member::config()->get('unique_identifier_field');
if ($uniqueIdentifier === 'Email') {
$emailField = EmailField::create('Email', _t('SilverStripe\\Security\\Member.EMAIL', 'Email'));
} else {
// This field needs to still be called Email, but we can re-label it
$emailField = TextField::create('Email', _t('SilverStripe\\Security\\Member.LOSTPASSWORDLABEL', $uniqueIdentifier));
}
return FieldList::create(
EmailField::create('Email', _t('SilverStripe\\Security\\Member.EMAIL', 'Email'))
$emailField
);
}

Expand Down

0 comments on commit c5843c9

Please sign in to comment.