Showing results for 
Search instead for 
Did you mean: 

2FA - Authy screen Country drop-down empty

2FA - Authy screen Country drop-down empty

Magento 2.4.1, I had 2FA working with BOTH Authy and Google Authenticator.


A 3rd-party extension @Amasty provider asked me to disable 2FA on my site temporarily, so I did via:

bin/magento module:disable Magento_TwoFactorAuth
bin/magento cache:flush

Now I've re-enabled 2FA by:

bin/magento module:enable Magento_TwoFactorAuth
bin/magento cache:flush

And now the 2FA - Authy login screen has an empty Country drop-down list, and which keeps Authy from working.


Empty Country drop-downEmpty Country drop-down

I have checked file permissions, reset caches, everything I could think of.


Can someone help me get this fixed - I really want to use Authy.





Re: 2FA - Authy screen Country drop-down empty

OK - I have figured out the problem, now I need some help to fix it.


It SEEMS like when I disabled Magento_TwoFactorAuth, it DELETED the CONTENTS of the tfa_country_codes table in the database.


That table is there, but EMPTY!


Then the subsequent re-enable of Magento_TwoFactorAuth did NOT RE-POPULATE that table!


So - can someone tell me how to cleanly repopulate that table in my database?


Re: 2FA - Authy screen Country drop-down empty

For anyone else who has this problem, I fixed it by exporting that database table "tfa_country_codes" as a csv file, from another install/database and importing it into the database table where it was missing.


However, I now have a new problem. When I go to login via authy, it sends the SMS to my phone, but comes up with this error on the Magento admin login page and does not allow you to continue:


Notice: Undefined index: carrier in ... /html/vendor/magento/module-two-factor-auth/Model/Provider/Engine/Authy/Verification.php on line 106
Line 106 in Verification.php is: 'carrier' => $response['carrier'],
Here is the whole function in Verification.php:
$this->userConfigManager->addProviderConfig((int) $user->getId(), Authy::CODE, [
'country_code' => $country,
'phone_number' => $phoneNumber,
'carrier' => $response['carrier'],
'mobile' => $response['is_cellphone'],
'verify' => [
'uuid' => $response['uuid'],
'via' => $method,
'expires' => $this->dateTime->timestamp() + $response['seconds_to_expire'],
'seconds_to_expire' => $response['seconds_to_expire'],
'message' => $response['message'],
'phone_confirmed' => false,
Any help with this would be much appreciated.