alt-design/alt-google-2fa-addon
Add Google two-factor authentication to your control panel logins. Users pair an authenticator app by scanning a QR code, then enter a six-digit code at sign-in—a simple, strong second layer of protection that fits into the existing login flow.
Architecture fit. This is a Statamic addon sitting on top of Laravel's package system, not a general-purpose Laravel 2FA library. It hooks TOTP (Google Authenticator-compatible) into the Statamic Control Panel login flow. As a TPM the fit question is not "is this good code" but "does our authentication surface belong to Statamic." If editors and admins log in through the CP, this is the cheapest credible way to add a second factor without writing or owning auth code. If our estate authenticates through plain Laravel, Fortify, Breeze, or an IdP/SSO, this addon is architecturally off-target and adopting it would create a second, parallel 2FA mechanism — which is a policy-drift problem, not a security improvement. Scope the decision to Statamic-owned CP authentication and nothing else.
Integration feasibility. Effort is genuinely small: one composer require, one config publish, cache clears, then per-user or enforced enrollment. The v1.1.3 release is a Statamic version-constraint bump only — no migrations, no new config keys, no behavioral changes. That is a positive health signal (the maintainer is tracking upstream) but it also tells us the addon's correctness is coupled to Statamic internals. The TPM-level feasibility question is therefore organizational, not technical: can we get CP users to enroll, and do we have a lockout path before we flip enforcement on?
Technical risk. Four things matter for planning:
Key questions.
APP_KEY, or stored recoverably?Stack fit. Adopt only where Statamic owns CP login — a Statamic-backed marketing site, docs portal, or lightweight CMS app. Reject for API-first services, customer-facing auth, or any product already standardized on Fortify or SSO. Duplicating 2FA across two mechanisms multiplies support load and makes "is this account protected?" unanswerable without checking two systems.
Migration path. Greenfield is composer require → publish config → clear caches (config:clear, cache:clear, statamic:stache:clear) → configure policy → pilot. Brownfield — replacing a manual or legacy 2FA process — must be additive: enroll users under the addon while the old mechanism stays live, measure coverage, then retire the old path. A hard cutover on a security control without a rollback window is the failure mode to design out.
Compatibility. Compatibility is the substance of v1.1.3, so treat it as a dependency-register event, not a routine patch. Pin the addon to an exact version per environment, record the resolved Statamic/Laravel matrix, and run composer why-not statamic/cms if resolution stalls — a locked older Statamic is usually the culprit, not the addon. Run the upgrade in staging with a real CP login, not a smoke test.
Sequencing.
Gate each step on evidence from the previous one. Do not compress steps 5–6; that is where most rollouts generate their incident load.
Environment parity. Commit the published config with env-driven values (ALT_2FA_ENFORCE=false in local/testing, true in production) so environments differ without code divergence, and ensure the pipeline runs config:cache after env vars are in place.
Maintenance. Small code footprint, non-zero attention. The addon must track Statamic releases — this release is evidence it does — so budget a recurring compatibility check each Statamic minor. Assign an explicit owner for the dependency relationship (version tracking, advisory monitoring, upgrade decisions). Leaving that to whoever ran the install is how constraint drift turns into a blocked platform upgrade six months later.
Support. Support burden concentrates almost entirely on enrollment and lockout, not on the package itself. Expect a predictable ticket taxonomy: "new phone, lost codes," "invalid code" (usually clock drift or a code typed outside the window), and "I can't get into the CP." Each needs a documented runbook and a named resolver before enforcement, not after the first locked-out editor. Also budget communication effort — some users will resist enrollment, and a well-explained opt-in phase costs far less than a surprise mandate.
Scaling. Negligible runtime cost. TOTP verification is a local HMAC computation with no third-party call, so there is no external latency, no vendor outage, and no per-seat licensing in the login path. The user population is the CP user base, typically small. The scaling concern is organizational: lockout-adjacent support volume grows roughly linearly with enrolled users, so the runbook and self-serve path matter more at 200 users than at 20.
Failure modes.
APP_KEY rotation — if secrets are encrypted with the app key, rotation mass-locks-out every enrolled user. Requires a planned migration, never a casual rotation.Ramp-up. Technically trivial for a Laravel developer — hours for install and configuration. The real ramp is procedural: enrollment comms, lockout runbook, break-glass procedure, and a staging validation of fail-closed behavior. Estimate a few days to operational readiness. Back up storage/ and the database before rollout, and treat the 2FA fields as migration-sensitive data.
Recommendation for a TPM. Proceed with a conditional adopt, scoped strictly to Statamic CP authentication. Make three verifications the gate to production: fail-closed enforcement, working recovery codes, and a tested break-glass reset. Treat v1.1.3 as a routine compatibility patch requiring no migration — the action item it generates is confirming the new Statamic version ceiling and re-running the staging auth flow. Keep the blast radius small (admin cohort first), name an owner, and document the lockout path before anyone is locked out. If the fail-closed check cannot be evidenced, do not enforce — an opt-in 2FA offering is a defensible interim position; a bypassable mandatory control is not.
How can I help you explore Laravel packages today?