DikkiX
(DikkiX)
1
Hi Again,
After Following the Readme instructions on
i get the error of class not found, but nowhere has been shown to create class ‘TwoFaQr’
now i get this error.
when trying to call the widget.
Anyone know what im doing wrong and if so, in what file to add the class?
Bizley
(Bizley)
3
DikkiX
(DikkiX)
4
Thing is, i was already calling an namespace
use promocat\models\TwoFaForm
As was written in the readme in the github
Bizley
(Bizley)
5
I can see in the code that namespace for that file is promocat\twofa\widgets
. Please check it first next time.
DikkiX
(DikkiX)
6
even adding that namespace, i get the same error
DikkiX
(DikkiX)
7
Update im still having this issue.
My user components look like this.
'components' => [
'authManager' => [
'class' => 'yii\rbac\DbManager', // or use 'yii\rbac\PhpManager'
],
'user' => [
'identityClass' => 'mdm\admin\models\User',
'loginUrl' => ['admin/user/login'],
'class' => promocat\twofa\User::class,
'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
],
'twoFa' => ['class' => promocat\twofa\TwoFa::class]
]
Hopefully someone knows something.
tri
(tri - Tommy Riboe)
8
use promocat\twofa\widgets\TwoFaQr;
DikkiX
(DikkiX)
9
Thanks, after doing this i got an error.
Attempt to read property “username” on null
I added this code into my Login.php
<div class="TwoFaQr">
<?= TwoFaQr::widget([
'accountName' => $model->user->username,
'secret' => $model->secret,
'issuer' => Yii::$app->params['twoFaIssuer'],
'size' => 300
]); ?>
</div>
If this is not supposed to be added in the Login.php please correct me.
I’ll show an screenshot of my code to see the overall.