Commit cf36bb47 authored by Joseph Silber's avatar Joseph Silber

Auth AJAX 401 response

parent 509b43ba
...@@ -35,7 +35,15 @@ App::after(function($request, $response) ...@@ -35,7 +35,15 @@ 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())
{
return Response::make('', 401, array('HTTP/1.1 401 Unauthorized'));
}
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