--- export const prerender = false; import AdminLayout from '../../layouts/AdminLayout.astro'; import { getSession, SESSION_COOKIE } from '../../lib/auth'; import { hasCredentials } from '../../lib/webauthn'; // Redirect if already logged in const sessionId = Astro.cookies.get(SESSION_COOKIE)?.value; const session = sessionId ? getSession(sessionId) : undefined; if (session) { return Astro.redirect('/admin'); } const registrationMode = !hasCredentials(); ---

admin access

{registrationMode ? (

Register your security key

No admin credentials are registered yet. Connect your YubiKey and click the button below to register it as the admin credential for this site.

Do this immediately after deployment — once registered, no further registrations will be accepted without resetting the database.

) : (

Login with your security key

Insert your YubiKey and click the button below to authenticate.

)}
{registrationMode ? ( ) : ( )}