FIX Ensure LoginForm on ContentController can load the member authenticator correctly

This commit is contained in:
Robbie Averill 2017-06-23 10:54:50 +12:00
parent ecbd778547
commit 8d23cfc2aa
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@ use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPResponse;
use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Control\HTTPResponse_Exception;
use SilverStripe\Core\Convert; use SilverStripe\Core\Convert;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\i18n\i18n; use SilverStripe\i18n\i18n;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataObject; use SilverStripe\ORM\DataObject;
@ -17,6 +18,7 @@ use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\FieldType\DBVarchar; use SilverStripe\ORM\FieldType\DBVarchar;
use SilverStripe\ORM\SS_List; use SilverStripe\ORM\SS_List;
use SilverStripe\Security\MemberAuthenticator\MemberAuthenticator;
use SilverStripe\Security\Permission; use SilverStripe\Security\Permission;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
use SilverStripe\SiteConfig\SiteConfig; use SilverStripe\SiteConfig\SiteConfig;
@ -311,10 +313,11 @@ class ContentController extends Controller
* *
* @todo Check if here should be returned just the default log-in form or * @todo Check if here should be returned just the default log-in form or
* all available log-in forms (also OpenID...) * all available log-in forms (also OpenID...)
* @return \SilverStripe\Security\MemberAuthenticator\MemberLoginForm
*/ */
public function LoginForm() public function LoginForm()
{ {
return MemberAuthenticator::singleton()->loginForm($this); return Injector::inst()->get(MemberAuthenticator::class)->getLoginHandler($this->Link())->loginForm();
} }
public function SilverStripeNavigator() public function SilverStripeNavigator()

View File

@ -204,4 +204,3 @@ class ContentControllerTest extends FunctionalTest
}); });
} }
} }