Cleanup SMTP auth handling

This commit is contained in:
the-djmaze 2024-03-25 19:36:39 +01:00
parent 55642e826e
commit c1e25dedb9
3 changed files with 3 additions and 8 deletions

View file

@ -106,7 +106,6 @@ trait UserAuth
} }
$this->Plugins()->RunHook('login.credentials', array(&$sEmail, &$sLogin, &$sPassword)); $this->Plugins()->RunHook('login.credentials', array(&$sEmail, &$sLogin, &$sPassword));
$this->logMask($sPassword);
$oPassword->setValue($sPassword); $oPassword->setValue($sPassword);
} }

View file

@ -70,12 +70,9 @@ abstract class Account implements \JsonSerializable
$this->oPassword = $oPassword; $this->oPassword = $oPassword;
} }
public function SetSmtpPassword( public function SetSmtpPassword(SensitiveString $oPassword) : void
#[\SensitiveParameter]
string $sPassword
) : void
{ {
$this->oSmtpPassword = new SensitiveString($sPassword); $this->oSmtpPassword = $oPassword;
} }
#[\ReturnTypeWillChange] #[\ReturnTypeWillChange]
@ -169,7 +166,7 @@ abstract class Account implements \JsonSerializable
// init smtp user/password // init smtp user/password
if (isset($aAccountHash['smtp'])) { if (isset($aAccountHash['smtp'])) {
$oAccount->sSmtpLogin = $aAccountHash['smtp']['user']; $oAccount->sSmtpLogin = $aAccountHash['smtp']['user'];
$oAccount->SetSmtpPassword($aAccountHash['smtp']['pass']); $oAccount->SetSmtpPassword(new SensitiveString($aAccountHash['smtp']['pass']));
} }
} }
} }

View file

@ -61,7 +61,6 @@
} }
}"></div> }"></div>
<span style="opacity:0.7"> (user@example.com → user)</span> <span style="opacity:0.7"> (user@example.com → user)</span>
<span style="opacity:0.7"> (user@example.com → user)</span>
<br> <br>
<div style="display: inline-block;" data-bind="component: { <div style="display: inline-block;" data-bind="component: {
name: 'Checkbox', name: 'Checkbox',