expects json
This commit is contained in:
parent
51addd6c63
commit
b787586514
|
@ -55,7 +55,7 @@ public function render($request, Exception $e)
|
||||||
*/
|
*/
|
||||||
protected function unauthenticated($request, AuthenticationException $e)
|
protected function unauthenticated($request, AuthenticationException $e)
|
||||||
{
|
{
|
||||||
if ($request->ajax() || $request->wantsJson()) {
|
if ($request->expectsJson()) {
|
||||||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
return response()->json(['error' => 'Unauthenticated.'], 401);
|
||||||
} else {
|
} else {
|
||||||
return redirect()->guest('login');
|
return redirect()->guest('login');
|
||||||
|
|
Loading…
Reference in New Issue