From a241995734cecff39f57732916a73052caf4c175 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 7 Feb 2026 18:35:43 -1000 Subject: Fix passkey registration showing broken UI when WebAuthn not configured Root cause: WEBAUTHN_RP_ID and WEBAUTHN_ORIGIN env vars not set in production, so WebAuthn is nil and all passkey endpoints return 404. The settings page was unconditionally showing the passkey registration card, leading to confusing "Failed to start registration" errors. Fix: Pass WebAuthnEnabled flag from main.go through Handler to the settings template, which now conditionally renders the passkey card only when WebAuthn is properly configured. Co-Authored-By: Claude Opus 4.6 --- web/templates/settings.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'web/templates') diff --git a/web/templates/settings.html b/web/templates/settings.html index 0803ae3..964d319 100644 --- a/web/templates/settings.html +++ b/web/templates/settings.html @@ -206,6 +206,7 @@ + {{if .WebAuthnEnabled}}
Passkeys
@@ -219,10 +220,12 @@
+ {{end}}