aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user/auth
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-01-07 23:41:46 +0800
committerGitHub <noreply@github.com>2024-01-07 15:41:46 +0000
commita04f8c0f81f55a8b927ce0fad8127db39396f892 (patch)
treef3c1c28b050e66abc6734da46daa1c1a22f9caaf /templates/user/auth
parent79da4bbc566cd3b1c028ca0b747c196fc02990f7 (diff)
downloadgitea-a04f8c0f81f55a8b927ce0fad8127db39396f892.tar.gz
gitea-a04f8c0f81f55a8b927ce0fad8127db39396f892.zip
Move the captcha script loader to the template which really needs it (#28718)
It improves the maintainability for the templates. Now `base/footer.tmpl` doesn't need to depend on "captcha" feature.
Diffstat (limited to 'templates/user/auth')
-rw-r--r--templates/user/auth/captcha.tmpl3
1 files changed, 3 insertions, 0 deletions
diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl
index c4e58d0134..1c3379e629 100644
--- a/templates/user/auth/captcha.tmpl
+++ b/templates/user/auth/captcha.tmpl
@@ -11,10 +11,12 @@
<div class="inline field required">
<div id="captcha" data-captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
</div>
+ <script src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
{{else if eq .CaptchaType "hcaptcha"}}
<div class="inline field required">
<div id="captcha" data-captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
</div>
+ <script src='https://hcaptcha.com/1/api.js'></script>
{{else if eq .CaptchaType "mcaptcha"}}
<div class="inline field">
<label></label>
@@ -25,4 +27,5 @@
<div class="inline field gt-text-center">
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
</div>
+ <script src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
{{end}}{{end}}