2FA and incoming text code

One annoying thing that happens to me when logging into some websites has to do with two factor authentication I think. On some websites (but not all) during login, I receive a text with a code which I have to enter before login is complete. On some websites the code I received via text is populated automatically by my iMac and on other sites (a lot of sites I use for work) it is not.

I’m not sure why this happens with some websites but not others, but is there any app or Safari extension that would help with the login process? I asked Jeff Johnson about his Safari Extension Stop the Madness, but he says his app won’t help. Any ideas here?

Thanks in advance.

Agreed, it’s annoying. You need the field to have an autocomplete value of autocomplete="one-time-code". An extension would probably need manual training to fix inputs with a missing or incorrect value, like what 1PW does for a bunch of sites.

1 Like

If you have Keyboard Maestro, you could put this into a macro that executes a shell script. You could probably do something with Automator or Text Expander, etc. too based on this code.

sqlite3 -line ~/Library/Messages/chat.db 'SELECT MAX(date), text FROM message m INNER JOIN handle h ON h.ROWID=m.handle_id WHERE is_from_me=0 GROUP BY h.ROWID ORDER BY date DESC LIMIT 1' | grep -o '[0-9]\+' | tail -1

It searches the database that Messages maintains, gets the most recent message that is not from you, and extracts the numeric portion. Keyboard Maestro can then paste that value into the field in Safari (or Brave, etc.)

This is what the macro looks like:

Caveat emptor, your mileage may vary, void where prohibited, (sorry Tennessee).

3 Likes

Thanks guys, but I’m not a programmer and I don’t use Keyboard Maestro. Any other solutions? Strange that the auto-populate from incoming text is disabled from some sites but not others.