1

I've just installed Magento and tried to log into it as an admin. However, the Two-Factor Authentication message showed up:

enter image description here

After a bit of looking up, I decided to disable the Two-Factor Authentication by setting

'Magento_TwoFactorAuth' => 0

in xampp/htdocs/magento2/app/etc/config.php and then run 'php bin/magento s:up' command.

After that, I tried to access my site and this was what I got:

enter image description here

What had gone wrong and how should I fix it?

4 Answers 4

3

Please run the following command, and the site will be up. The website is broken because you have not deployed static content.

php -d memory_limit=-1 bin/magento module:disable Magento_TwoFactorAuth
php -d memory_limit=-1 bin/magento setup:upgrade
php -d memory_limit=-1 bin/magento setup:static-content:deploy -f
php -d memory_limit=-1 bin/magento cache:clean

And if you are using the latest version of Magento, please disable the module using the command below:

php -d memory_limit=-1 bin/magento module:disable Magento_TwoFactorAuth Magento_AdminAdobeImsTwoFactorAuth
2
  • 1
    This has worked for me. Thank you significantly!
    – Ngoc
    Commented Dec 7, 2023 at 11:08
  • Yep this is the best solution. Commented Dec 9, 2023 at 2:11
0

Please run the below commands in magento root

php bin/magento mo:d Magento_TwoFactorAuth;
rm -rf var/ generated/;
php bin/magento s:up;
php bin/magento s:d:c;
php bin/magento s:s:d -f;
php bin/magento c:f;
4
  • I followed your guide and the site frontend showed up again. However, when I access /admin, fill in my username and password, nothing happened. I still couldn't log in as an admin. Why was that?
    – Ngoc
    Commented Dec 7, 2023 at 11:00
  • Now go into root generated folder and check metadata folder is generated or not. if it's generated then delete it and then try to relogin. Commented Dec 7, 2023 at 11:04
  • I tried 'php -d memory_limit=-1 bin/magento module:disable Magento_TwoFactorAuth Magento_AdminAdobeImsTwoFactorAuth' and now I can log into my site as an admin. Still, your method helped me fix the broken frontend. Thank you!
    – Ngoc
    Commented Dec 7, 2023 at 11:10
  • Ok that's amazing , If it's resolved then like and accept the answer Commented Dec 7, 2023 at 11:12
0
  1. After disabling the module click logout and clear your browser cache and after that try to login.
  2. And for the design is not loading is because you run the command setup:upgrade but didn't run the setup:static-content:deploy -f command, please run all the command and after that this should work
php bin/magento setup:upgrade
php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
0

Please Run the following command in Magento Root

php bin/magento module:disable Magento_TwoFactorAuth;
php bin/magento s:up;
php bin/magento setup:di:compile;
php bin/magento s:s:d -f;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.