@@ -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"
@@ -414,6 +415,8 @@ func SignUp(ctx *context.Context) {
414
415
ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
415
416
ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
416
417
ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
418
+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
419
+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
417
420
ctx .Data ["PageIsSignUp" ] = true
418
421
419
422
// Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -435,6 +438,8 @@ func SignUpPost(ctx *context.Context) {
435
438
ctx .Data ["CaptchaType" ] = setting .Service .CaptchaType
436
439
ctx .Data ["RecaptchaSitekey" ] = setting .Service .RecaptchaSitekey
437
440
ctx .Data ["HcaptchaSitekey" ] = setting .Service .HcaptchaSitekey
441
+ ctx .Data ["McaptchaSitekey" ] = setting .Service .McaptchaSitekey
442
+ ctx .Data ["McaptchaURL" ] = setting .Service .McaptchaURL
438
443
ctx .Data ["PageIsSignUp" ] = true
439
444
440
445
// Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -458,6 +463,8 @@ func SignUpPost(ctx *context.Context) {
458
463
valid , err = recaptcha .Verify (ctx , form .GRecaptchaResponse )
459
464
case setting .HCaptcha :
460
465
valid , err = hcaptcha .Verify (ctx , form .HcaptchaResponse )
466
+ case setting .MCaptcha :
467
+ valid , err = mcaptcha .Verify (ctx , form .McaptchaResponse )
461
468
default :
462
469
ctx .ServerError ("Unknown Captcha Type" , fmt .Errorf ("Unknown Captcha Type: %s" , setting .Service .CaptchaType ))
463
470
return
0 commit comments