stages/captcha: customisable URLs (#3832)

* make api and js url customisable

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

* use recaptcha.net domains

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

* add form

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

* regen locale

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens L
2022-12-18 15:18:43 +02:00
committed by GitHub
parent 2d18c1bb6f
commit ec925491b2
18 changed files with 360 additions and 75 deletions

View File

@ -43,7 +43,7 @@ export class CaptchaStageForm extends ModelForm<CaptchaStage, string> {
renderForm(): TemplateResult {
return html`<form class="pf-c-form pf-m-horizontal">
<div class="form-help-text">
${t`This stage checks the user's current session against the Google reCaptcha service.`}
${t`This stage checks the user's current session against the Google reCaptcha (or compatible) service.`}
</div>
<ak-form-element-horizontal label=${t`Name`} ?required=${true} name="name">
<input
@ -84,6 +84,39 @@ export class CaptchaStageForm extends ModelForm<CaptchaStage, string> {
</ak-form-element-horizontal>
</div>
</ak-form-group>
<ak-form-group>
<span slot="header"> ${t`Advanced settings`} </span>
<div slot="body" class="pf-c-form">
<ak-form-element-horizontal label=${t`JS URL`} ?required=${true} name="jsUrl">
<input
type="text"
value="${ifDefined(
this.instance?.jsUrl ||
"https://www.recaptcha.net/recaptcha/api.js",
)}"
class="pf-c-form-control"
required
/>
<p class="pf-c-form__helper-text">
${t`URL to fetch JavaScript from, defaults to recaptcha. Can be replaced with any compatible alternative.`}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${t`API URL`} ?required=${true} name="apiUrl">
<input
type="text"
value="${ifDefined(
this.instance?.apiUrl ||
"https://www.recaptcha.net/recaptcha/api/siteverify",
)}"
class="pf-c-form-control"
required
/>
<p class="pf-c-form__helper-text">
${t`URL used to validate captcha response, defaults to recaptcha. Can be replaced with any compatible alternative.`}
</p>
</ak-form-element-horizontal>
</div>
</ak-form-group>
</form>`;
}
}