Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Laravel Passport Route [login] not defined

// add an extra middleware with below handler

public function handle($request, Closure $next)
{
    if(!in_array($request->headers->get('accept'), ['application/json', 'Application/Json']))
        return response()->json(['message' => 'Unauthenticated.'], 401);

    return $next($request);
}

//set priority in app/Http/Kernel.php
 
PREVIOUS NEXT
Tagged: #Laravel #Passport #Route #defined
ADD COMMENT
Topic
Name
6+8 =