Auth AJAX 401 response

This commit is contained in:
Joseph Silber 2013-11-03 21:13:13 -05:00
parent 509b43ba80
commit cf36bb47c2
1 changed files with 9 additions and 1 deletions

View File

@ -35,7 +35,15 @@
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');
}
});