Support the ongoing development of Laravel.io →
Authentication Requests Validation
Last updated 1 year ago.
0

LoginController now uses AuthenticatesUsers trait directly. And there is (still) sendFailedLoginResponse(Request $request) method, which you should override and return the response you want. It'll be something like:

/**
 * Get the failed login response instance.
 *
 * @param \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
protected function sendFailedLoginResponse(Request $request)
{
    return response()->json([
        'error' => 'Credentials do not match, try again.'
    ], 406);
}
0

Sign in to participate in this thread!

Eventy

Your banner here too?

aberrant aberrant Joined 15 Sep 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.