| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function handle($request, Closure $next) |
||
| 18 | { |
||
| 19 | //Convert oauth 400 response to 401 without any payload |
||
| 20 | //It's required due to security reasons - we got two levels of "authentication" - the first is to check if user |
||
| 21 | //exists in IdentifyTenantByUsername middleware - so we need IDENTICAL(!) responses here and there |
||
| 22 | $response = $next($request); |
||
| 23 | |||
| 24 | if ($response->status() === 400) { |
||
| 25 | return response('', 401); |
||
| 26 | } |
||
| 27 | |||
| 28 | return $response; |
||
| 29 | } |
||
| 31 |