| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function handle($request, Closure $next) |
||
| 23 | { |
||
| 24 | $config = config('auth.simple', []); |
||
| 25 | |||
| 26 | if (! empty($config['enabled'])) { |
||
| 27 | if ($request->getUser() !== $config['user'] || $request->getPassword() !== $config['password']) { |
||
| 28 | $header = ['WWW-Authenticate' => 'Basic']; |
||
| 29 | |||
| 30 | return response('You have to supply your credentials to access this resource.', Response::HTTP_UNAUTHORIZED, $header); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | return $next($request); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |