Skip to content

Commit 4558eeb

Browse files
authored
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 <[email protected]>
1 parent be25afc commit 4558eeb

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
@@ -746,6 +746,7 @@ func LinkAccount(ctx *context.Context) {
746746
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
747747
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
748748
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
749+
ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
749750
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
750751
ctx.Data["ShowRegistrationButton"] = false
751752

@@ -797,6 +798,7 @@ func LinkAccountPostSignIn(ctx *context.Context, signInForm auth.SignInForm) {
797798
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
798799
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
799800
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
801+
ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
800802
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
801803
ctx.Data["ShowRegistrationButton"] = false
802804

@@ -881,6 +883,7 @@ func LinkAccountPostRegister(ctx *context.Context, cpt *captcha.Captcha, form au
881883
ctx.Data["RecaptchaURL"] = setting.Service.RecaptchaURL
882884
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
883885
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
886+
ctx.Data["HcaptchaSitekey"] = setting.Service.HcaptchaSitekey
884887
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
885888
ctx.Data["ShowRegistrationButton"] = false
886889

0 commit comments

Comments
 (0)