Work on 401 response from filter.

This commit is contained in:
Taylor Otwell 2014-02-28 16:02:46 -06:00
parent d286d94122
commit c457a93ddb
1 changed files with 8 additions and 3 deletions

View File

@ -37,10 +37,15 @@
{
if (Auth::guest())
{
if (Request::ajax()) App::abort(401);
if (Request::ajax())
{
return Response::make('Unauthorized', 401);
}
else
{
return Redirect::guest('login');
}
}
});