Merge pull request #4805 from driesvints/fix-api-redirect

[5.7] Don't redirect for api calls
This commit is contained in:
Taylor Otwell 2018-10-12 08:44:32 -05:00 committed by GitHub
commit b637ee304c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -14,6 +14,8 @@ class Authenticate extends Middleware
*/
protected function redirectTo($request)
{
return route('login');
if (! $request->expectsJson()) {
return route('login');
}
}
}