mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
This commit is contained in:
parent
5882cc6051
commit
7db9fb36fa
1 changed files with 13 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue