From e4c595360f2cf2b8e5f28681af4167a8000921ae Mon Sep 17 00:00:00 2001 From: John Rallis Date: Sat, 9 Mar 2024 21:11:15 +0200 Subject: [PATCH] make auto renewal upon expiry optional --- src/Altcha.svelte | 3 ++- src/types.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Altcha.svelte b/src/Altcha.svelte index fbcbf9b..4e7efbd 100644 --- a/src/Altcha.svelte +++ b/src/Altcha.svelte @@ -15,6 +15,7 @@ export let challengejson: string | undefined = undefined; export let debug: boolean = false; export let expire: number | undefined = undefined; + export let autorenew: boolean = true; export let hidefooter: boolean = false; export let hidelogo: boolean = false; export let name: string = 'altcha'; @@ -168,7 +169,7 @@ } function expireChallenge() { - if (challengeurl && state === State.VERIFIED) { + if (challengeurl && autorenew && state === State.VERIFIED) { // re-fetch challenge and verify again verify(); diff --git a/src/types.ts b/src/types.ts index 151b677..a5463ea 100644 --- a/src/types.ts +++ b/src/types.ts @@ -13,6 +13,7 @@ export interface Configure { challenge?: Challenge; debug?: boolean; expire?: number; + autorenew?: boolean; hidefooter?: boolean; hidelogo?: boolean; maxnumber?: number;