| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | protected function performChecks() |
||
| 17 | { |
||
| 18 | $token = $this->request->getHeader( |
||
| 19 | Config::get('app.authHeader') |
||
| 20 | ); |
||
| 21 | if (empty($token)) { |
||
| 22 | throw new UnAuthorizedException('Missing Header'); |
||
| 23 | } |
||
| 24 | |||
| 25 | $this->userId = UserToken::getValidUserId( |
||
| 26 | $token, |
||
| 27 | $this->request->getAttribute('ip_address') |
||
| 28 | ); |
||
| 29 | if (empty($this->userId)) { |
||
| 30 | // Log attempt then remove token? |
||
| 31 | throw new UnAuthorizedException('Unauthorized'); |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | } |