@@ -18,6 +18,7 @@ import (
18
18
"code.gitea.io/gitea/modules/eventsource"
19
19
"code.gitea.io/gitea/modules/hcaptcha"
20
20
"code.gitea.io/gitea/modules/log"
21
+ "code.gitea.io/gitea/modules/mcaptcha"
21
22
"code.gitea.io/gitea/modules/password"
22
23
"code.gitea.io/gitea/modules/recaptcha"
23
24
"code.gitea.io/gitea/modules/session"
@@ -415,6 +416,8 @@ func SignUp(ctx *context.Context) {
415
416
ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
416
417
ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
417
418
ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
419
+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
420
+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
418
421
ctx .Data ["PageIsSignUp" ] = true
419
422
420
423
// Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -436,6 +439,8 @@ func SignUpPost(ctx *context.Context) {
436
439
ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
437
440
ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
438
441
ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
442
+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
443
+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
439
444
ctx .Data ["PageIsSignUp" ] = true
440
445
441
446
// Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -459,6 +464,8 @@ func SignUpPost(ctx *context.Context) {
459
464
valid , err = recaptcha .Verify (ctx , form .GRecaptchaResponse )
460
465
case setting .HCaptcha :
461
466
valid , err = hcaptcha .Verify (ctx , form .HcaptchaResponse )
467
+ case setting .MCaptcha :
468
+ valid , err = mcaptcha .Verify (ctx , form .McaptchaResponse )
462
469
default :
463
470
ctx .ServerError ("Unknown Captcha Type" , fmt .Errorf ("Unknown Captcha Type: %s" , setting .Service .CaptchaType ))
464
471
return
0 commit comments