Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Modify JSON error format for AuthenticatesUsers #20067

Merged
merged 2 commits into from
Jul 14, 2017
Merged

[5.5] Modify JSON error format for AuthenticatesUsers #20067

merged 2 commits into from
Jul 14, 2017

Conversation

themsaid
Copy link
Member

No description provided.

@@ -127,7 +127,7 @@ protected function sendFailedLoginResponse(Request $request)
$errors = [$this->username() => trans('auth.failed')];

if ($request->expectsJson()) {
return response()->json($errors, 422);
return response()->json(['message' => 'Authentication failed.'], 422);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would still want the message to be trans('auth.failed') and the $errors variable is now unused.

@taylorotwell taylorotwell merged commit 6c9093f into laravel:master Jul 14, 2017
@cretueusebiu
Copy link
Contributor

Why the change to message in the JSON response ? I usually display the errors bellow the input using it's name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants