adds user accounts, service requests, dashboard, admin panel, better layout, db+altcha+auth support

This commit is contained in:
Aidan 2025-07-07 20:01:59 -04:00
parent dfbc3cade9
commit 0043a5bf3c
40 changed files with 3981 additions and 188 deletions

22
util/captcha.ts Normal file
View file

@ -0,0 +1,22 @@
import { verifySolution } from "altcha-lib";
export async function verifyCaptcha(token: string): Promise<boolean> {
const hmacKey = process.env.ALTCHA_SECRET;
if (!hmacKey) {
console.error("ALTCHA_SECRET is not set");
return false;
}
if (!token) {
return false;
}
try {
const isValid = await verifySolution(token, hmacKey);
return isValid;
} catch (error) {
console.error("[ALTCHA] Error:", error);
return false;
}
}