Files
devstar/templates/user/auth/captcha.tmpl
DAI Mingchen 3b768dac65 Squashed commit of the following:
commit 2ed4e3e307
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 11:48:00 2024 +0000

    resolved WARN NoEmptyContinuation (grammar mistakes), and removed trivial unit test for hCAPTCHA

commit 690157811b
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 10:21:39 2024 +0000

    fix: checkout the corresponding branch(master or dev)

commit 046ff63e42
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 10:01:24 2024 +0000

    test new CI pipeline workflow in the org repo, with a bunch of ENV vars

commit faf7f51d85
Author: 戴明辰 <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 07:59:31 2024 +0000

    !1 DevStar Studio 界面原型 + CI流水线测试通过
    * finalize this PoC repo, and migrate to the main repo (as a dev branch)
    * bugFix: nullptr dereference @ routers/web/auth/wechat_utils.go
    * bugFix: CAPTCHA needs manual reloading
    * Updated UI
    * Changed logo and favicon
    * Made WeChat QR optional (will not cause HTTP 500 Internal Error), and …
    * Added Unit Test in CI workflow, and removed redundant tests in dev container
    * Compliance with open source licensing requirements
    * Fix workflow: only exec 'docker rm' if there are dangling volumes
    * Removed Magic values about: Docker registry(URL, username), k8s(nanesp…
    * fix mistakes: git checkout branch should be master rather than the sta…
    * Updated UI layouts and build scripts
    * Updated copyright info and ICP License ID at page footer
    * Updated ICP License ID at page footer
    * Updated code ownership: web footer,  logo and favicon
    * Updated Internationalization(i18n): removed languages other than CN an…
2024-07-30 12:46:01 +00:00

32 lines
1.5 KiB
Handlebars
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{/* TODO: k8s deployment replicas */}}
{{if .EnableCaptcha}}{{if eq .CaptchaType "image"}}
<div class="inline field">
{{.Captcha.CreateHTML}}
</div>
<div class="required field {{if .Err_Captcha}}error{{end}}">
<label for="captcha">{{ctx.Locale.Tr "captcha"}}</label>
<input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
</div>
{{else if eq .CaptchaType "recaptcha"}}
<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>
<div class="m-captcha-style" id="mcaptcha__widget-container"></div>
<div id="captcha" data-captcha-type="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
</div>
{{else if eq .CaptchaType "cfturnstile"}}
<div class="inline field tw-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}}