Skip to content
Snippets Groups Projects
Commit 681ac9f1 authored by Robin Appelman's avatar Robin Appelman
Browse files

Check if an app provide two-factor-auth providers before we try to use them

parent e36decc1
No related branches found
No related tags found
No related merge requests found
...@@ -109,15 +109,17 @@ class Manager { ...@@ -109,15 +109,17 @@ class Manager {
foreach ($allApps as $appId) { foreach ($allApps as $appId) {
$info = $this->appManager->getAppInfo($appId); $info = $this->appManager->getAppInfo($appId);
$providerClasses = $info['two-factor-providers']; if (isset($info['two-factor-providers'])) {
foreach ($providerClasses as $class) { $providerClasses = $info['two-factor-providers'];
try { foreach ($providerClasses as $class) {
$this->loadTwoFactorApp($appId); try {
$provider = OC::$server->query($class); $this->loadTwoFactorApp($appId);
$providers[$provider->getId()] = $provider; $provider = OC::$server->query($class);
} catch (QueryException $exc) { $providers[$provider->getId()] = $provider;
// Provider class can not be resolved } catch (QueryException $exc) {
throw new Exception("Could not load two-factor auth provider $class"); // Provider class can not be resolved
throw new Exception("Could not load two-factor auth provider $class");
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment