yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Cannot activate 2FA | nothing happens

Open TimoB2005 opened this issue 2 years ago • 6 comments

What steps will reproduce the problem?

  • 'enableTwoFactorAuthentication' => true | in config
  • go into account settings and try to activate 2fa

What is the expected result?

  • activated 2fa

What do you get instead?

  • this link in url: http://localhost:8080/user/settings/account#tfmodal
  • nothing happens after that

Thats the button that should trigger that: https://github.com/2amigos/yii2-usuario/blob/master/src/User/resources/views/settings/account.php#L130

PHP: 8.1.2 Composer:

        "yiisoft/yii2": "~2.0.14",
        "yiisoft/yii2-bootstrap4": "~2.0.0",
        "2amigos/yii2-usuario": "~1.6.1",
        "2amigos/2fa-library": "^2.0.2",
        "2amigos/qrcode-library": "^2.0"

TimoB2005 avatar Oct 31 '23 13:10 TimoB2005

I'm running Yii2 (advanced project) version 2.0.49.2 on Apache2, MySQL8, PHP 8.1.2

In composer I've required the following packages:

require 2amigos/yii2-usuario "^1";
require 2amigos/2fa-library "^2";
require 2amigos/qrcode-library "^2";

Ending up having installed:

2amigos/yii2-usuario:1.6.1
2amigos/2fa-library:2.0.2
2amigos/qrcode-library:2.0.0

In my common\config\main.php::modules->user->twoFactorAuthenticationValidators array (User Guide) I've specified :

'google-authenticator'=>[
	'class'            =>'\Da\User\Validator\TwoFactorCodeValidator',
	'description'      =>'Authenticator App',
	'configurationUrl' =>'user/settings/two-factor',
	'enabled'          =>true
],

Everything seems to be working just fine. Hope to have been of any kind of help.

edegaudenzi avatar Nov 13 '23 12:11 edegaudenzi

@edegaudenzi what bootstrap version?

TimoB2005 avatar Nov 13 '23 16:11 TimoB2005

https://github.com/2amigos/yii2-usuario/assets/83423736/3f444e90-0672-41cb-9056-4b2a4e307f54

So my problem is when i click on one method nothing happens but when i type in my password click save then the 2fa field changes.

I can activate like email 2FA and get the Mail but nothing opens to type in the code or similar

TimoB2005 avatar Nov 13 '23 17:11 TimoB2005

I'm using the one for Yii2, yiisoft/yii2-bootstrap:2.0.11. Video is very explanatory, it should show you a popup with a qrcode indeed. In the very moment when you click, anything in the webserver logs, Yii2 logs, browser 'console' or browser 'network' tabs?

edegaudenzi avatar Nov 14 '23 10:11 edegaudenzi

I'm using the one for Yii2, yiisoft/yii2-bootstrap:2.0.11. Video is very explanatory, it should show you a popup with a qrcode indeed. In the very moment when you click, anything in the webserver logs, Yii2 logs, browser 'console' or browser 'network' tabs?

What is your AppAsset.php on that bootstrap?

I am using currently "yiisoft/yii2-bootstrap4": "~2.0.0",

Would like to try with your version.

No errors and logs but when i click on save with password and then execute like email 2fa an Request gets called and i get the Mail too. But nothing Opens or something. I guess its a Bootstrap Problem

TimoB2005 avatar Nov 14 '23 10:11 TimoB2005

Okay got things running up with your bootstrap version.

Now the Div looks like the one when i enter my password instantly.

But the thing is i still need to enter my password click on save and then the modal sends me mail.

When i only click 2fa without saving user data before nothing happens.

Then it opens the input field but there is a div before so i cant click anything in the code field.

TimoB2005 avatar Nov 14 '23 10:11 TimoB2005