Merge pull request #2399 from JosephSilber/auth-ajax-401
Auth should respond with a 401 to AJAX requests
This commit is contained in:
@@ -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');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user