Auth AJAX 401 response
This commit is contained in:
parent
509b43ba80
commit
cf36bb47c2
|
@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue