Skip to content

Commit c912434

Browse files
committed
Update error response, so that they reflect the correct input name
1 parent f1ad2dd commit c912434

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Http/Responses/FailedPasswordResetLinkRequestResponse.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Validation\ValidationException;
66
use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse as FailedPasswordResetLinkRequestResponseContract;
7+
use Laravel\Fortify\Fortify;
78

89
class FailedPasswordResetLinkRequestResponse implements FailedPasswordResetLinkRequestResponseContract
910
{
@@ -35,12 +36,12 @@ public function toResponse($request)
3536
{
3637
if ($request->wantsJson()) {
3738
throw ValidationException::withMessages([
38-
'email' => [trans($this->status)],
39+
Fortify::email() => [trans($this->status)],
3940
]);
4041
}
4142

4243
return back()
43-
->withInput($request->only('email'))
44-
->withErrors(['email' => trans($this->status)]);
44+
->withInput($request->only(Fortify::email()))
45+
->withErrors([Fortify::email() => trans($this->status)]);
4546
}
4647
}

src/Http/Responses/FailedPasswordResetResponse.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Validation\ValidationException;
66
use Laravel\Fortify\Contracts\FailedPasswordResetResponse as FailedPasswordResetResponseContract;
7+
use Laravel\Fortify\Fortify;
78

89
class FailedPasswordResetResponse implements FailedPasswordResetResponseContract
910
{
@@ -35,12 +36,12 @@ public function toResponse($request)
3536
{
3637
if ($request->wantsJson()) {
3738
throw ValidationException::withMessages([
38-
'email' => [trans($this->status)],
39+
Fortify::email() => [trans($this->status)],
3940
]);
4041
}
4142

4243
return back()
43-
->withInput($request->only('email'))
44-
->withErrors(['email' => trans($this->status)]);
44+
->withInput($request->only(Fortify::email()))
45+
->withErrors([Fortify::email() => trans($this->status)]);
4546
}
4647
}

0 commit comments

Comments
 (0)