1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-21 13:52:35 +02:00

Suppress uncaught Hybridauth exceptions in e_user_provider

And add a check for those exceptions in
`social_ui::generateSocialLoginSection()`

Fixes: #4192
This commit is contained in:
Nick Liu
2021-12-28 11:51:20 +01:00
parent b40288d665
commit 3f59b3bc14
3 changed files with 64 additions and 8 deletions

View File

@@ -606,6 +606,19 @@ class social_ui extends e_admin_ui
foreach ($provider_names as $provider_name)
{
// Check if the current configuration for the provider is valid
try
{
new e_user_provider($provider_name, [], false);
}
catch (\Hybridauth\Exception\InvalidArgumentException $e)
{
e107::getMessage()->addError("[{$e->getCode()}] {$e->getMessage()}");
}
catch (\Hybridauth\Exception\UnexpectedValueException $ignored)
{
}
$text .= $this->generateSocialLoginRow($provider_name, $readonly);
}