Skip to content

Commit 4b3b828

Browse files
committed
Modify custom attribute
Custom attribute changed from `captcha-type` to `data-captcha-type`
1 parent 0d185a7 commit 4b3b828

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

templates/user/auth/captcha.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
</div>
1010
{{else if eq .CaptchaType "recaptcha"}}
1111
<div class="inline field required">
12-
<div id="captcha" captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
12+
<div id="captcha" data-captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
1313
</div>
1414
{{else if eq .CaptchaType "hcaptcha"}}
1515
<div class="inline field required">
16-
<div id="captcha" captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
16+
<div id="captcha" data-captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
1717
</div>
1818
{{else if eq .CaptchaType "mcaptcha"}}
1919
<div class="inline field df ac db-small captcha-field">
2020
<span>{{.locale.Tr "captcha"}}</span>
2121
<div class="border-secondary w-100-small" id="mcaptcha__widget-container" style="width: 50%; height: 5em"></div>
22-
<div id="captcha" captcha-type="m-captcha" class="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
22+
<div id="captcha" data-captcha-type="m-captcha" class="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
2323
</div>
2424
{{else if eq .CaptchaType "cfturnstile"}}
2525
<div class="inline field captcha-field tc">
26-
<div id="captcha" captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
26+
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
2727
</div>
2828
{{end}}{{end}}

web_src/js/features/captcha.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function initCaptcha() {
1212
theme: isDark ? 'dark' : 'light'
1313
};
1414

15-
switch (captchaEl.getAttribute('captcha-type')) {
15+
switch (captchaEl.getAttribute('data-captcha-type')) {
1616
case 'g-recaptcha': {
1717
if (window.grecaptcha) {
1818
window.grecaptcha.ready(() => {

0 commit comments

Comments
 (0)