Add contact actions and migrate contact form to Astro actions

Implement send_otp and send_msg handlers with server-side validation,
captcha verification, OTP generation/verification, rate limiting,
session-backed multi-step flow, and SMS gateway integration.

Replace broken contact endpoint and types with Astro server actions;
delete endpoints/contact.ts, types/ContactForm.ts and
src/components/ContactForm.astro. Update pages/contact.astro to use
astro:actions and improve captcha handling (listen for solve and set
hidden input). Adjust OTP timing (step 60s → 300s, VALID_PAST_OTP_STEPS
5 → 1). Add validator, @types/validator, Prettier and
prettier-plugin-astro; include .prettierrc.mjs in tsconfig include.

Add Prettier config for Astro
This commit is contained in:
badblocks 2026-01-22 12:25:20 -08:00
parent 608348a5a5
commit f2f42a84b5
No known key found for this signature in database
12 changed files with 360 additions and 746 deletions

View file

@ -1,6 +1,6 @@
{
"extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"],
"include": [".astro/types.d.ts", "**/*", ".prettierrc.mjs"],
"exclude": ["dist"],
"compilerOptions": {
"verbatimModuleSyntax": true,
@ -9,7 +9,7 @@
"@layouts/*": ["./src/layouts/*"],
"@lib/*": ["./src/lib/*"],
"@pages/*": ["./src/pages/*"],
"@types/*": ["./src/types/*"],
"@actions/*": ["./src/actions/*"],
},
"plugins": [
{