mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-26 16:26:44 +03:00
Resolve #1647
This commit is contained in:
parent
f177bb2f31
commit
fad4dea1c5
1 changed files with 7 additions and 4 deletions
|
|
@ -6,8 +6,8 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
NAME = 'Login External',
|
NAME = 'Login External',
|
||||||
AUTHOR = 'SnappyMail',
|
AUTHOR = 'SnappyMail',
|
||||||
URL = 'https://snappymail.eu/',
|
URL = 'https://snappymail.eu/',
|
||||||
VERSION = '1.3',
|
VERSION = '1.4',
|
||||||
RELEASE = '2024-03-27',
|
RELEASE = '2024-07-01',
|
||||||
REQUIRED = '2.36.1',
|
REQUIRED = '2.36.1',
|
||||||
CATEGORY = 'Login',
|
CATEGORY = 'Login',
|
||||||
LICENSE = 'MIT',
|
LICENSE = 'MIT',
|
||||||
|
|
@ -31,9 +31,12 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$oAccount = $oActions->LoginProcess($sEmail, $sPassword);
|
// Convert password to SensitiveString type
|
||||||
|
$oPassword = new \SnappyMail\SensitiveString($sPassword);
|
||||||
|
$oAccount = $oActions->LoginProcess($sEmail, $oPassword);
|
||||||
if (!$oAccount instanceof \RainLoop\Model\MainAccount) {
|
if (!$oAccount instanceof \RainLoop\Model\MainAccount) {
|
||||||
$oAccount = null;
|
$oAccount = null;
|
||||||
|
\SnappyMail\LOG::info(\get_class($this), 'LoginProcess failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (\Throwable $oException)
|
catch (\Throwable $oException)
|
||||||
|
|
@ -53,7 +56,7 @@ class LoginExternalPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
if ($oException instanceof \RainLoop\Exceptions\ClientException) {
|
if ($oException instanceof \RainLoop\Exceptions\ClientException) {
|
||||||
$aResult['ErrorCode'] = $oException->getCode();
|
$aResult['ErrorCode'] = $oException->getCode();
|
||||||
} else {
|
} else {
|
||||||
$aResult['ErrorCode'] = Notifications::AuthError;
|
$aResult['ErrorCode'] = \RainLoop\Notifications::AuthError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo \json_encode($aResult);
|
echo \json_encode($aResult);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue