From fbb74be46b61c2d9ce27ad692a8bf412efaaa8f4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 12 Aug 2024 07:28:02 +0900 Subject: [PATCH] fix: add missing placeholder value to `Auth.invalidEmail` See https://github.com/codeigniter4/shield/pull/1145/files#diff-1677e08813ba69d90fb595a88c6c64b98c1fc3edb6f832ede2559d6eb2e61dd1R95 --- src/Authentication/Actions/Email2FA.php | 2 +- tests/Controllers/ActionsTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Authentication/Actions/Email2FA.php b/src/Authentication/Actions/Email2FA.php index 1d1e69c1c..28216d8cd 100644 --- a/src/Authentication/Actions/Email2FA.php +++ b/src/Authentication/Actions/Email2FA.php @@ -73,7 +73,7 @@ public function handle(IncomingRequest $request) } if (empty($email) || $email !== $user->email) { - return redirect()->route('auth-action-show')->with('error', lang('Auth.invalidEmail')); + return redirect()->route('auth-action-show')->with('error', lang('Auth.invalidEmail', [$email])); } $identity = $this->getIdentity($user); diff --git a/tests/Controllers/ActionsTest.php b/tests/Controllers/ActionsTest.php index ee8650122..8f30afb99 100644 --- a/tests/Controllers/ActionsTest.php +++ b/tests/Controllers/ActionsTest.php @@ -103,7 +103,7 @@ public function testEmail2FAHandleInvalidEmail(): void $result->assertRedirect(); $this->assertSame(site_url('/auth/a/show'), $result->getRedirectUrl()); - $result->assertSessionHas('error', lang('Auth.invalidEmail')); + $result->assertSessionHas('error', lang('Auth.invalidEmail', ['foo@example.com'])); } private function insertIdentityEmal2FA(): void