Rename providerset method to get primary providers

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2018-08-08 20:28:21 +02:00
parent c6e47e8a51
commit d8197f2b97
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
3 changed files with 3 additions and 3 deletions

View File

@ -334,7 +334,7 @@ class LoginController extends Controller {
if ($this->twoFactorManager->isTwoFactorAuthenticated($loginResult)) {
$this->twoFactorManager->prepareTwoFactorLogin($loginResult, $remember_login);
$providers = $this->twoFactorManager->getProviderSet($loginResult)->get3rdPartyProviders();
$providers = $this->twoFactorManager->getProviderSet($loginResult)->getPrimaryProviders();
if (count($providers) === 1) {
// Single provider, hence we can redirect to that provider's challenge page directly
/* @var $provider IProvider */

View File

@ -70,7 +70,7 @@ class ProviderSet {
/**
* @return IProvider[]
*/
public function get3rdPartyProviders(): array {
public function getPrimaryProviders(): array {
return array_filter($this->providers, function(IProvider $provider) {
return !($provider instanceof BackupCodesProvider);
});

View File

@ -64,7 +64,7 @@ class ProviderSetTest extends TestCase {
$set = new ProviderSet([$p2, $p1], false);
$this->assertEquals($expected, $set->get3rdPartyProviders());
$this->assertEquals($expected, $set->getPrimaryProviders());
}
public function testGetProvider() {