Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
41 | public function run() |
||
42 | { |
||
43 | $user = $this->user; |
||
44 | if (!$user->auth_tf_key) { |
||
45 | $user->auth_tf_key = (new Manager())->generateSecretKey(); |
||
46 | $user->updateAttributes(['auth_tf_key']); |
||
47 | } |
||
48 | |||
49 | $totpUri = (new TOTPSecretKeyUriGeneratorService(Yii::$app->name, $user->email, $user->auth_tf_key))->run(); |
||
50 | |||
51 | return (new QrCodeDataUriGeneratorService($totpUri))->run(); |
||
52 | } |
||
53 | } |
||
54 |