Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | public function handle($request, Closure $next) |
||
12 | { |
||
13 | if (stripos($request->header('User-Agent'), 'Checkr-Webhook') === false) { |
||
14 | Log::alert('Invalid user agent for Checkr webhook'); |
||
15 | abort(404); |
||
|
|||
16 | } |
||
17 | |||
18 | if (hash_hmac('SHA256', $request->getContent(), Checkr::getKey()) !== $request->header('X-Checkr-Signature')) { |
||
19 | Log::alert('Checkr signature does not match request.'); |
||
20 | abort(404); |
||
21 | } |
||
22 | |||
23 | return $next($request); |
||
24 | } |
||
26 |