Total Complexity | 14 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
8 | class Google2FAAuthenticator extends Authenticator |
||
9 | { |
||
10 | protected function canPassWithoutCheckingOTP(): bool |
||
11 | { |
||
12 | if (! $this->getUser()->passwordSecurity) { |
||
13 | return true; |
||
14 | } |
||
15 | |||
16 | return |
||
17 | ! $this->getUser()->passwordSecurity->google2fa_enable || |
||
18 | ! $this->isEnabled() || |
||
19 | $this->noUserIsAuthenticated() || |
||
20 | $this->twoFactorAuthStillValid() || |
||
21 | $this->isDeviceTrusted(); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Check if current device is trusted |
||
26 | */ |
||
27 | protected function isDeviceTrusted(): bool |
||
57 | } |
||
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return mixed |
||
62 | * |
||
63 | * @throws InvalidSecretKey |
||
64 | */ |
||
65 | protected function getGoogle2FASecretKey() |
||
74 | } |
||
75 | } |
||
76 |