aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-03-01 15:12:48 +0000
committerGitHub <noreply@github.com>2021-03-01 16:12:48 +0100
commit4558eeb21a8249fc6d89d2b05d134bcfde6aaac6 (patch)
tree3e48e255dec903e0fcf010ccf7ed1c661ae8fbaf
parentbe25afc6def888f9ec83b3e8ebe1c1fed216b19a (diff)
downloadgitea-4558eeb21a8249fc6d89d2b05d134bcfde6aaac6.tar.gz
gitea-4558eeb21a8249fc6d89d2b05d134bcfde6aaac6.zip
Set HCaptchaSiteKey on Link Account pages (#14834) (#14839)
Backport #14834 When using HCaptcha on link account pages the site key needs to be passed in. This PR ensures that HCaptchaSiteKey is set in the data. Fix #14766 Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--routers/user/auth.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index c5542456a1..6544c51f88 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -746,6 +746,7 @@ func LinkAccount(ctx *context.Context) {
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
+ ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
ctx.Data["ShowRegistrationButton"] = false
@@ -797,6 +798,7 @@ func LinkAccountPostSignIn(ctx *context.Context, signInForm auth.SignInForm) {
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
+ ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
ctx.Data["ShowRegistrationButton"] = false
@@ -881,6 +883,7 @@ func LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form au
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
+ ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
ctx.Data["ShowRegistrationButton"] = false