Use cached query

Fixes https://github.com/silverstripe/silverstripe-framework/issues/10833
This commit is contained in:
Thomas Portelange 2023-06-22 11:04:26 +02:00 committed by GitHub
parent ab4802caaf
commit 2e73b5eeca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ namespace SilverStripe\Security\MemberAuthenticator;
use SilverStripe\Control\Controller;
use SilverStripe\Control\Cookie;
use SilverStripe\ORM\DataObject;
use SilverStripe\Control\Director;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Security\AuthenticationHandler;
@ -59,7 +60,7 @@ class SessionAuthenticationHandler implements AuthenticationHandler
return null;
}
/** @var Member $member */
$member = Member::get()->byID($id);
$member = DataObject::get_by_id("SilverStripe\\Security\\Member", $id);
return $member;
}