prepare('SELECT COUNT(*) FROM passkeys WHERE rp_id = ?'); $st->execute([webauthn_rp_id()]); $hasPasskeys = (int)$st->fetchColumn() > 0; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { check_csrf(); $pass = (string)($_POST['password'] ?? ''); if ($firstRun) { if (strlen($pass) < 8) { $error = 'Password must be at least 8 characters.'; } elseif ($pass !== (string)($_POST['confirm'] ?? '')) { $error = 'Passwords do not match.'; } else { save_password($pass); log_in(); remember_login(); flash('Password set. Welcome!'); header('Location: index.php'); exit; } } elseif (verify_password($pass)) { log_in(); remember_login(); header('Location: index.php'); exit; } else { sleep(1); $error = 'Wrong password.'; } } page_header($firstRun ? 'Set password' : 'Login'); ?>

First run: choose the admin password for this site. It will be required for adding, editing, and using filament.