From 4626118d77e03244d51ecc7e0f641080b79bccee Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 12 Dec 2022 14:31:49 -0700 Subject: [PATCH] app: fix remaining email config keys --- .../Controllers/Admin/Settings/MailController.php | 4 ++-- .../Admin/Settings/MailSettingsFormRequest.php | 14 +++++++------- app/Providers/SettingsServiceProvider.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Admin/Settings/MailController.php b/app/Http/Controllers/Admin/Settings/MailController.php index 2db87fd58..050990d33 100644 --- a/app/Http/Controllers/Admin/Settings/MailController.php +++ b/app/Http/Controllers/Admin/Settings/MailController.php @@ -57,8 +57,8 @@ class MailController extends Controller } $values = $request->normalize(); - if (array_get($values, 'mail:password') === '!e') { - $values['mail:password'] = ''; + if (array_get($values, 'mail:mailers:smtp:password') === '!e') { + $values['mail:mailers:smtp:password'] = ''; } foreach ($values as $key => $value) { diff --git a/app/Http/Requests/Admin/Settings/MailSettingsFormRequest.php b/app/Http/Requests/Admin/Settings/MailSettingsFormRequest.php index 4475b08fd..3f014e982 100644 --- a/app/Http/Requests/Admin/Settings/MailSettingsFormRequest.php +++ b/app/Http/Requests/Admin/Settings/MailSettingsFormRequest.php @@ -13,11 +13,11 @@ class MailSettingsFormRequest extends AdminFormRequest public function rules(): array { return [ - 'mail:host' => 'required|string', - 'mail:port' => 'required|integer|between:1,65535', - 'mail:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])], - 'mail:username' => 'nullable|string|max:191', - 'mail:password' => 'nullable|string|max:191', + 'mail:mailers:smtp:host' => 'required|string', + 'mail:mailers:smtp:port' => 'required|integer|between:1,65535', + 'mail:mailers:smtp:encryption' => ['present', Rule::in([null, 'tls', 'ssl'])], + 'mail:mailers:smtp:username' => 'nullable|string|max:191', + 'mail:mailers:smtp:password' => 'nullable|string|max:191', 'mail:from:address' => 'required|string|email', 'mail:from:name' => 'nullable|string|max:191', ]; @@ -31,8 +31,8 @@ class MailSettingsFormRequest extends AdminFormRequest { $keys = array_flip(array_keys($this->rules())); - if (empty($this->input('mail:password'))) { - unset($keys['mail:password']); + if (empty($this->input('mail:mailers:smtp:password'))) { + unset($keys['mail:mailers:smtp:password']); } return $this->only(array_flip($keys)); diff --git a/app/Providers/SettingsServiceProvider.php b/app/Providers/SettingsServiceProvider.php index 528e3ae50..8ed183543 100644 --- a/app/Providers/SettingsServiceProvider.php +++ b/app/Providers/SettingsServiceProvider.php @@ -51,7 +51,7 @@ class SettingsServiceProvider extends ServiceProvider * configuration array. */ protected static array $encrypted = [ - 'mail:password', + 'mail:mailers:smtp:password', ]; /**