Skip to content

Two Factor Authentication

Alan Paynter edited this page Aug 7, 2026 · 1 revision

Two-Factor Authentication

Wren can ask for a six-digit code as well as your password when you sign in to the admin. It uses standard TOTP (RFC 6238), so any authenticator app works: Google Authenticator, Authy, Microsoft Authenticator, 1Password, and the rest. It is off by default and entirely optional.

Turning it on

Go to Settings and scroll to Two-factor authentication, then click Set up two-factor. Wren shows a setup key. In your authenticator app, choose to add an account by entering a key (sometimes called "manual entry" or "enter a setup key"), give it any name you like, paste the key, and make sure the type is time-based. Some apps also accept the otpauth:// address shown beneath the key.

Your app will start showing a six-digit code that changes every thirty seconds. Type the current one into Wren and press Turn on two-factor.

This step is deliberate: Wren will not switch two-factor on until you have proved a working code, so you cannot lock yourself out during setup. If the code is refused, check that your phone's clock is set automatically — a phone several minutes out of step is the usual culprit.

There is no QR code. Adding a couple of hundred lines of QR-drawing code to a single-file CMS did not feel like a fair trade for saving one paste.

Recovery codes

The moment two-factor is enabled, Wren shows eight recovery codes. Each one works exactly once in place of an app code. Save them somewhere safe before leaving the page — a password manager, or printed and put somewhere sensible. They are shown once and stored only as hashes, so nobody can read them back out of your database, and Wren cannot show them to you again.

Settings displays how many remain unused. If you run low, turn two-factor off and on again to be issued a fresh set.

Signing in

Enter your username and password as usual, then the current code from your app. If your phone is unavailable, type one of your recovery codes into the same box instead.

A few details worth knowing: a code that has been used cannot be used again, so if you sign in twice within the same thirty seconds you will need to wait for the next code. One step of clock drift either way is accepted. Repeated wrong codes are slowed down deliberately.

Turning it off

In Settings, confirm your password and press Turn off two-factor. The secret and any unused recovery codes are deleted, and signing in returns to one step.

If you lose your phone and your recovery codes

There is no email reset — Wren sends no email at all. You will need database access: open wren.db with a SQLite tool (some hosts offer phpLiteAdmin) and set the totp_secret column in the users table to an empty string. That turns two-factor off for that account and your password alone will sign you in again. If you have no SQLite tool, upload a one-line PHP script beside index.php that performs the same update, run it once, and delete it immediately afterwards.

Clone this wiki locally