From 7db9fb36fa8b4ef6277f09e01d1d4d39a8e0c08a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sat, 15 Oct 2022 18:39:00 +0200 Subject: [PATCH] https://github.com/the-djmaze/snappymail/issues/96#issuecomment-1279776563 --- .../snappymail/lib/Util/SnappyMailHelper.php | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php index 938a6ec40..e868f50d8 100644 --- a/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php +++ b/integrations/nextcloud/snappymail/lib/Util/SnappyMailHelper.php @@ -39,17 +39,21 @@ class SnappyMailHelper } $bSave && $oConfig->Save(); - $oActions = \RainLoop\Api::Actions(); - if (!$oActions->getMainAccountFromToken(false)) { - $aCredentials = SnappyMailHelper::getLoginCredentials(); - if ($aCredentials[0] && $aCredentials[1]) { - $oActions->Logger()->AddSecret($aCredentials[1]); - $oAccount = $oActions->LoginProcess($aCredentials[0], $aCredentials[1], false); - if ($oAccount) { - $oActions->Plugins()->RunHook('login.success', array($oAccount)); - $oActions->SetAuthToken($oAccount); + try { + $oActions = \RainLoop\Api::Actions(); + if (!$oActions->getMainAccountFromToken(false)) { + $aCredentials = SnappyMailHelper::getLoginCredentials(); + if ($aCredentials[0] && $aCredentials[1]) { + $oActions->Logger()->AddSecret($aCredentials[1]); + $oAccount = $oActions->LoginProcess($aCredentials[0], $aCredentials[1], false); + if ($oAccount) { + $oActions->Plugins()->RunHook('login.success', array($oAccount)); + $oActions->SetAuthToken($oAccount); + } } } + } catch (\Throwable $e) { + // Ignore login failure } }