diff --git a/lib/challenge/proofofwork/proofofwork.templ b/lib/challenge/proofofwork/proofofwork.templ index 94b841ff..7a270830 100644 --- a/lib/challenge/proofofwork/proofofwork.templ +++ b/lib/challenge/proofofwork/proofofwork.templ @@ -7,7 +7,7 @@ import ( templ page(localizer *localization.SimpleLocalizer) {
- { localizer.T("loading") }

diff --git a/lib/challenge/proofofwork/proofofwork_templ.go b/lib/challenge/proofofwork/proofofwork_templ.go index 48d2df2d..93999d88 100644 --- a/lib/challenge/proofofwork/proofofwork_templ.go +++ b/lib/challenge/proofofwork/proofofwork_templ.go @@ -34,14 +34,14 @@ func page(localizer *localization.SimpleLocalizer) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
document.documentElement.lang; @@ -91,7 +66,7 @@ const getRedirectUrl = () => { }; let translations: Record = {}; -let currentLang; +let currentLang: string; // Initialize translations const initTranslations = async () => { @@ -179,7 +154,16 @@ function App({ anubisVersion, basePrefix }: AppProps) { } } - const { challenge, rules } = j("anubis_challenge"); + const challengeData = j("anubis_challenge"); + if (!challengeData) { + showError( + t("challenge_error"), + t("challenge_data_missing"), + imageURL("reject", anubisVersion, basePrefix), + ); + return; + } + const { challenge, rules } = challengeData; const process = algorithms[rules.algorithm]; if (!process) {