Rename providerset method to get primary providers

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
pull/10588/head
Christoph Wurst 8 years ago
parent c6e47e8a51
commit d8197f2b97
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
  1. 2
      core/Controller/LoginController.php
  2. 2
      lib/private/Authentication/TwoFactorAuth/ProviderSet.php
  3. 2
      tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php

@ -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 */

@ -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);
});

@ -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() {

Loading…
Cancel
Save