Przeglądaj źródła

Rename providerset method to get primary providers

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
tags/v14.0.0beta4
Christoph Wurst 5 lat temu
rodzic
commit
d8197f2b97
No account linked to committer's email address

+ 1
- 1
core/Controller/LoginController.php Wyświetl plik

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

+ 1
- 1
lib/private/Authentication/TwoFactorAuth/ProviderSet.php Wyświetl plik

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

+ 1
- 1
tests/lib/Authentication/TwoFactorAuth/ProviderSetTest.php Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz