Refactor password handling in EmailAccountDto
Replaced the `EncryptedPassword` property in `EmailAccountDto` with `Password` and `PasswordEncrypted` to support both plain text and encrypted passwords. Updated `LimilabsEmailService` to use the new properties, checking the `PasswordEncrypted` flag to determine whether decryption is needed.
This commit is contained in:
@@ -91,7 +91,8 @@ public class LimilabsEmailService(
|
||||
}
|
||||
else
|
||||
{
|
||||
var password = encryptionService.Decrypt(_smtpAccount.EncryptedPassword!);
|
||||
var password = _smtpAccount.PasswordEncrypted ? encryptionService.Decrypt(_smtpAccount.Password) : _smtpAccount.Password;
|
||||
|
||||
smtp.Login(_smtpAccount.Username, password);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user