Merge pull request #2399 from JosephSilber/auth-ajax-401

Auth should respond with a 401 to AJAX requests
This commit is contained in:
Taylor Otwell 2014-02-28 16:01:32 -06:00
commit d286d94122
1 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,12 @@
Route::filter('auth', function()
{
if (Auth::guest()) return Redirect::guest('login');
if (Auth::guest())
{
if (Request::ajax()) App::abort(401);
return Redirect::guest('login');
}
});