| Conditions | 2 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | protected function verifySignature() |
||
| 37 | { |
||
| 38 | $data = $this->timestamp.$this->token; |
||
| 39 | |||
| 40 | $signature = hash_hmac('sha256', $data, config('mailbox.services.mailgun.key')); |
||
| 41 | |||
| 42 | $signed = hash_equals($this->signature, $signature); |
||
| 43 | |||
| 44 | abort_unless($signed && $this->isFresh($this->timestamp), 401, 'Invalid Mailgun signature or timestamp.'); |
||
| 45 | } |
||
| 52 |