Skip to content

Commit 030646e

Browse files
Set HCaptchaSiteKey on Link Account pages (#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 <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent 83cf1a8 commit 030646e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

routers/user/auth.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ func LinkAccount(ctx *context.Context) {
751751
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
752752
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
753753
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
754+
ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
754755
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
755756
ctx.Data["ShowRegistrationButton"] = false
756757

@@ -804,6 +805,7 @@ func LinkAccountPostSignIn(ctx *context.Context) {
804805
ctx.Data["Captcha"] = context.GetImageCaptcha()
805806
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
806807
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
808+
ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
807809
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
808810
ctx.Data["ShowRegistrationButton"] = false
809811

@@ -890,6 +892,7 @@ func LinkAccountPostRegister(ctx *context.Context) {
890892
ctx.Data["Captcha"] = context.GetImageCaptcha()
891893
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
892894
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
895+
ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
893896
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
894897
ctx.Data["ShowRegistrationButton"] = false
895898

0 commit comments

Comments
 (0)