Simplify LoginProcess handling

This commit is contained in:
the-djmaze 2024-03-28 02:43:39 +01:00
parent 6be84f8ab4
commit 3017f8c656
9 changed files with 24 additions and 47 deletions

View file

@ -92,15 +92,8 @@ class SnappyMailHelper
if ($doLogin && $aCredentials[1] && $aCredentials[2]) {
try {
$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::DefaultOff) === \RainLoop\Enumerations\SignMeType::DefaultOn) {
$oActions->SetSignMeToken($oAccount);
}
if ($oAccount && $oConfig->Get('login', 'sign_me_auto', \RainLoop\Enumerations\SignMeType::DefaultOff) === \RainLoop\Enumerations\SignMeType::DefaultOn) {
$oActions->SetSignMeToken($oAccount);
}
} catch (\Throwable $e) {
// Login failure, reset password to prevent more attempts