Browse Source

Work on 401 response from filter.

Taylor Otwell 11 years ago
parent
commit
c457a93ddb
1 changed files with 8 additions and 3 deletions
  1. 8 3
      app/filters.php

+ 8 - 3
app/filters.php

@@ -37,9 +37,14 @@ Route::filter('auth', function()
 {
 	if (Auth::guest())
 	{
-		if (Request::ajax()) App::abort(401);
-
-		return Redirect::guest('login');
+		if (Request::ajax())
+		{
+			return Response::make('Unauthorized', 401);
+		}
+		else
+		{
+			return Redirect::guest('login');
+		}
 	}
 });