@@ -18,6 +18,7 @@ import (
1818 "code.gitea.io/gitea/modules/eventsource"
1919 "code.gitea.io/gitea/modules/hcaptcha"
2020 "code.gitea.io/gitea/modules/log"
21+ "code.gitea.io/gitea/modules/mcaptcha"
2122 "code.gitea.io/gitea/modules/password"
2223 "code.gitea.io/gitea/modules/recaptcha"
2324 "code.gitea.io/gitea/modules/session"
@@ -414,6 +415,8 @@ func SignUp(ctx *context.Context) {
414415 ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
415416 ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
416417 ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
418+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
419+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
417420 ctx .Data ["PageIsSignUp" ] = true
418421
419422 // Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -435,6 +438,8 @@ func SignUpPost(ctx *context.Context) {
435438 ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
436439 ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
437440 ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
441+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
442+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
438443 ctx .Data ["PageIsSignUp" ] = true
439444
440445 // Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -458,6 +463,8 @@ func SignUpPost(ctx *context.Context) {
458463 valid , err = recaptcha .Verify (ctx , form .GRecaptchaResponse )
459464 case setting .HCaptcha :
460465 valid , err = hcaptcha .Verify (ctx , form .HcaptchaResponse )
466+ case setting .MCaptcha :
467+ valid , err = mcaptcha .Verify (ctx , form .McaptchaResponse )
461468 default :
462469 ctx .ServerError ("Unknown Captcha Type" , fmt .Errorf ("Unknown Captcha Type: %s" , setting .Service .CaptchaType ))
463470 return
0 commit comments