Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | trait TOTPAware |
||
14 | { |
||
15 | /** |
||
16 | * Gets the encryption key to use from environment variables. This is generated by default on the Common Web |
||
17 | * Platform, but can be defined as a custom value if required. |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | protected function getEncryptionKey(): string |
||
22 | { |
||
23 | return (string) Environment::getEnv('SS_MFA_SECRET_KEY'); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Get an instance of the TOTP handler service. The secret must already be defined and set to the StoreInterface. |
||
28 | * |
||
29 | * @param StoreInterface $store |
||
30 | * @return TOTPInterface |
||
31 | * @throws RuntimeException |
||
32 | */ |
||
33 | protected function getTotp(StoreInterface $store): TOTPInterface |
||
40 | } |
||
41 | } |
||
42 |