Commit d286d941 authored by Taylor Otwell's avatar Taylor Otwell

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

Auth should respond with a 401 to AJAX requests
parents b7557837 23cc411c
...@@ -35,7 +35,12 @@ App::after(function($request, $response) ...@@ -35,7 +35,12 @@ App::after(function($request, $response)
Route::filter('auth', function() Route::filter('auth', function()
{ {
if (Auth::guest()) return Redirect::guest('login'); if (Auth::guest())
{
if (Request::ajax()) App::abort(401);
return Redirect::guest('login');
}
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment