@@ -20,7 +20,8 @@ |
||
| 20 | 20 | if (Auth::guard($guard)->guest()) { |
| 21 | 21 | if ($request->ajax() || $request->wantsJson()) { |
| 22 | 22 | return response('Unauthorized.', 401); |
| 23 | - } else { |
|
| 23 | + } |
|
| 24 | + else { |
|
| 24 | 25 | return redirect()->guest('login'); |
| 25 | 26 | } |
| 26 | 27 | } |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | namespace App\Http\Middleware; |
| 3 | 3 | |
| 4 | 4 | use Closure; |
| 5 | -use Illuminate\Contracts\Auth\Guard; |
|
| 6 | 5 | use Dingo\Api\Http; |
| 7 | 6 | use Dingo\Api\Routing\Helpers; |
| 7 | +use Illuminate\Contracts\Auth\Guard; |
|
| 8 | 8 | use Illuminate\Http\Request; |
| 9 | 9 | |
| 10 | 10 | class SetViewVariable |