1 | <?php |
||
12 | class Authenticator extends Google2FA |
||
13 | { |
||
14 | use ErrorBag, Input, Response, Session; |
||
15 | |||
16 | /** |
||
17 | * The current password. |
||
18 | * |
||
19 | * @var |
||
20 | */ |
||
21 | protected $password; |
||
22 | |||
23 | /** |
||
24 | * Authenticator constructor. |
||
25 | * |
||
26 | * @param \Illuminate\Http\Request $request |
||
27 | */ |
||
28 | 8 | public function __construct(IlluminateRequest $request) |
|
32 | |||
33 | /** |
||
34 | * Authenticator boot. |
||
35 | * |
||
36 | * @param $request |
||
37 | * |
||
38 | * @return Google2FA |
||
39 | */ |
||
40 | 8 | public function boot($request) |
|
46 | |||
47 | /** |
||
48 | * Authenticator boot for API usage. |
||
49 | * |
||
50 | * @param $request |
||
51 | * |
||
52 | * @return Google2FA |
||
53 | */ |
||
54 | 1 | public function bootStateless($request) |
|
62 | |||
63 | /** |
||
64 | * Fire login (success or failed). |
||
65 | * |
||
66 | * @param $succeeded |
||
67 | */ |
||
68 | 5 | private function fireLoginEvent($succeeded) |
|
78 | |||
79 | /** |
||
80 | * Get the OTP from user input. |
||
81 | * |
||
82 | * @throws InvalidOneTimePassword |
||
83 | * |
||
84 | * @return mixed |
||
85 | */ |
||
86 | 6 | protected function getOneTimePassword() |
|
98 | |||
99 | /** |
||
100 | * Check if the current use is authenticated via OTP. |
||
101 | * |
||
102 | * @return bool |
||
103 | */ |
||
104 | 8 | public function isAuthenticated() |
|
110 | |||
111 | /** |
||
112 | * Check if it is already logged in or passable without checking for an OTP. |
||
113 | * |
||
114 | * @return bool |
||
115 | */ |
||
116 | 8 | protected function canPassWithoutCheckingOTP() |
|
124 | |||
125 | /** |
||
126 | * Check if the input OTP is valid. |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | 8 | protected function checkOTP() |
|
142 | |||
143 | /** |
||
144 | * Verify the OTP. |
||
145 | * |
||
146 | * @throws InvalidOneTimePassword |
||
147 | * |
||
148 | * @return mixed |
||
149 | */ |
||
150 | 6 | protected function verifyOneTimePassword() |
|
154 | } |
||
155 |