| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function handle($request, Closure $next, $guard) |
||
| 23 | { |
||
| 24 | app()->singleton('tymon.jwt.auth', function () use ($guard) { |
||
| 25 | /** @var GuardContract $auth */ |
||
| 26 | $auth = auth($guard); |
||
| 27 | |||
| 28 | return new JWTAuth(app('tymon.jwt.manager'), new Illuminate($auth), app('tymon.jwt.parser')); |
||
| 29 | }); |
||
| 30 | |||
| 31 | $this->auth = app('tymon.jwt.auth'); |
||
| 32 | |||
| 33 | if ($this->auth->parser()->setRequest($request)->hasToken()) { |
||
| 34 | try { |
||
| 35 | $this->auth->parseToken()->authenticate(); |
||
| 36 | } catch (Exception $e) { |
||
| 37 | // |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | return $next($request); |
||
| 42 | } |
||
| 44 |