Merge pull request #2399 from JosephSilber/auth-ajax-401
Auth should respond with a 401 to AJAX requests
This commit is contained in:
commit
d286d94122
|
@ -35,7 +35,12 @@
|
|||
|
||||
Route::filter('auth', function()
|
||||
{
|
||||
if (Auth::guest()) return Redirect::guest('login');
|
||||
if (Auth::guest())
|
||||
{
|
||||
if (Request::ajax()) App::abort(401);
|
||||
|
||||
return Redirect::guest('login');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue