@@ -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"
@@ -415,6 +416,8 @@ func SignUp(ctx *context.Context) {
415416 ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
416417 ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
417418 ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
419+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
420+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
418421 ctx .Data ["PageIsSignUp" ] = true
419422
420423 // Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -436,6 +439,8 @@ func SignUpPost(ctx *context.Context) {
436439 ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
437440 ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
438441 ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
442+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
443+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
439444 ctx .Data ["PageIsSignUp" ] = true
440445
441446 // Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -459,6 +464,8 @@ func SignUpPost(ctx *context.Context) {
459464 valid , err = recaptcha .Verify (ctx , form .GRecaptchaResponse )
460465 case setting .HCaptcha :
461466 valid , err = hcaptcha .Verify (ctx , form .HcaptchaResponse )
467+ case setting .MCaptcha :
468+ valid , err = mcaptcha .Verify (ctx , form .McaptchaResponse )
462469 default :
463470 ctx .ServerError ("Unknown Captcha Type" , fmt .Errorf ("Unknown Captcha Type: %s" , setting .Service .CaptchaType ))
464471 return
0 commit comments