Search the blog

Imagine you are using ProcessWire and are sending emails via SMTP and you have installed the TfaEmail module (two-factor authentication module for WireMail). And then your SMTP account fails (or you have not set it up yet as you are still in development). How do you login?

Easy. Add this code to the bottom of site/templates/admin.php:

$session->forceLogin('admin');

Then visit the admin: E.g. /processwire/. You will now be logged in without a password.

Now, remove the above code from admin.php and disable TfaEmail in Site > Modules.

Tim Bennett is a freelance web designer from Leeds. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.