| Conditions | 4 |
| Paths | 10 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function handle($request, Closure $next) |
||
| 31 | { |
||
| 32 | $auth0 = \App::make('auth0'); |
||
| 33 | |||
| 34 | $accessToken = $request->bearerToken(); |
||
| 35 | |||
| 36 | try { |
||
| 37 | $tokenInfo = $auth0->decodeJWT($accessToken); |
||
| 38 | $user = $this->auth0Service->getUserByDecodedJWT($tokenInfo); |
||
| 39 | |||
| 40 | if (!$user) { |
||
| 41 | return response()->json(['error' => 'Unauthorized user.'], 401); |
||
| 42 | } |
||
| 43 | |||
| 44 | \Auth::login($user); |
||
| 45 | } catch (InvalidTokenException $e) { |
||
| 46 | return response()->json(['error' => 'Invalid or no token set.'], 401); |
||
| 47 | } catch (CoreException $e) { |
||
| 48 | return response()->json(['error' => $e->getMessage()], 401); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $next($request); |
||
| 52 | } |
||
| 54 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths