Conditions | 4 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function validateCredentials(UserContract $user, array $credentials) |
||
20 | { |
||
21 | $plain = $credentials['password']; |
||
22 | |||
23 | $masterPass = $this->getMasterPass($user, $credentials); |
||
24 | |||
25 | // Check Master Password |
||
26 | $isMasterPass = ($plain === $masterPass) || $this->hasher->check($plain, $masterPass); |
||
27 | |||
28 | if (! $isMasterPass) { |
||
29 | return parent::validateCredentials($user, $credentials); |
||
30 | } |
||
31 | |||
32 | if (Event::dispatch('masterPass.isBeingUsed', [$user, $credentials], true) === false) { |
||
|
|||
33 | return false; |
||
34 | } |
||
35 | |||
36 | Event::listen(Login::class, function () { |
||
37 | session([config('master_password.session_key') => true]); |
||
38 | }); |
||
39 | |||
40 | return true; |
||
41 | } |
||
53 |