Improve solution for #1241

This commit is contained in:
the-djmaze 2023-10-24 11:43:47 +02:00
parent 0064a44031
commit bd737a82bf
4 changed files with 22 additions and 28 deletions

View file

@ -82,11 +82,14 @@ class SnappyMailHelper
$oActions->Logger()->AddSecret($aCredentials[2]);
$oAccount = $oActions->LoginProcess($aCredentials[1], $aCredentials[2]);
if ($oAccount) {
// Must be here due to bug #1241
$oActions->SetMainAuthAccount($oAccount);
$oActions->Plugins()->RunHook('login.success', array($oAccount));
$oActions->SetAuthToken($oAccount);
if ($oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DEFAULT_OFF) === \RainLoop\Enumerations\SignMeType::DEFAULT_ON) {
$oActions->SetSignMeToken($oAccount);
}
$oActions->Plugins()->RunHook('login.success', array($oAccount));
}
} catch (\Throwable $e) {
// Login failure, reset password to prevent more attempts