Auth should respond with a 401 to AJAX requests
@@ -35,7 +35,12 @@ App::after(function($request, $response)
Route::filter('auth', function()
{
- if (Auth::guest()) return Redirect::guest('login');
+ if (Auth::guest())
+ {
+ if (Request::ajax()) App::abort(401);
+
+ return Redirect::guest('login');
+ }
});