| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace VojtaSvoboda\CodeLogin\Repositories; |
||
| 26 | public function getUserByPassword($password) |
||
| 27 | { |
||
| 28 | foreach ($this->getAllUsers() as $user) { |
||
| 29 | |||
| 30 | try { |
||
| 31 | $user = Auth::findUserByCredentials([ |
||
| 32 | 'email' => $user->email, |
||
| 33 | 'password' => $password, |
||
| 34 | ]); |
||
| 35 | |||
| 36 | return $user; |
||
| 37 | |||
| 38 | } catch(AuthException $e) { |
||
| 39 | $user = null; |
||
| 40 | } |
||
| 41 | |||
| 42 | } |
||
| 43 | |||
| 44 | return null; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |