| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function handle($request, Closure $next) |
||
| 38 | { |
||
| 39 | // Low level way to only allow TT users |
||
| 40 | // this is not a safe way to handle security and is only used for convenience, not to secure page restriction!! |
||
| 41 | if (! $this->auth->user() || ! $this->authorize('update-squanto')) { |
||
| 42 | if ($request->ajax()) { |
||
| 43 | return response('Unauthorized.', 401); |
||
| 44 | } else { |
||
| 45 | return redirect()->guest('admin/login'); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | return $next($request); |
||
| 50 | } |
||
| 52 |