mirror of https://github.com/sussy-code/smov.git
Fix turnstiles mostly!
This commit is contained in:
parent
02a3fbc879
commit
94246484b0
|
@ -90,21 +90,11 @@ export function WorkerTestPart() {
|
|||
} catch (err) {
|
||||
const error = err as Error;
|
||||
error.message = error.message.replace(worker.url, "WORKER_URL");
|
||||
if (
|
||||
error.message ===
|
||||
'[Cloudflare Turnstile] Invalid or missing type for parameter "sitekey", expected "string", got "object".'
|
||||
) {
|
||||
updateWorker(worker.id, {
|
||||
id: worker.id,
|
||||
status: "success",
|
||||
});
|
||||
} else {
|
||||
updateWorker(worker.id, {
|
||||
id: worker.id,
|
||||
status: "error",
|
||||
error,
|
||||
});
|
||||
}
|
||||
updateWorker(worker.id, {
|
||||
id: worker.id,
|
||||
status: "error",
|
||||
error,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -81,9 +81,6 @@ export async function getTurnstileToken() {
|
|||
const turnstile = getTurnstile();
|
||||
try {
|
||||
// I hate turnstile
|
||||
if (turnstile.controls.isExpired()) {
|
||||
turnstile.controls.reset();
|
||||
}
|
||||
(window as any).turnstile.execute(
|
||||
document.querySelector(`#${turnstile.id}`),
|
||||
{},
|
||||
|
@ -101,7 +98,7 @@ export function TurnstileProvider(props: {
|
|||
isInPopout?: boolean;
|
||||
onUpdateShow?: (show: boolean) => void;
|
||||
}) {
|
||||
const siteKey = conf().TURNSTILE_KEY?.toString();
|
||||
const siteKey = conf().TURNSTILE_KEY;
|
||||
const idRef = useRef<string | null>(null);
|
||||
const setTurnstile = useTurnstileStore((s) => s.setTurnstile);
|
||||
const processToken = useTurnstileStore((s) => s.processToken);
|
||||
|
|
Loading…
Reference in New Issue