Skip to content

Commit 055d75a

Browse files
authored
Merge pull request #482 from chaitin/feat-captcha
feat: 支持注册 captcha
2 parents ff1b628 + 0790230 commit 055d75a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

backend/bridge.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/chaitin/MonkeyCode/backend/domain"
1515
"github.com/chaitin/MonkeyCode/backend/errcode"
1616
"github.com/chaitin/MonkeyCode/backend/pkg"
17+
"github.com/chaitin/MonkeyCode/backend/pkg/captcha"
1718
"github.com/chaitin/MonkeyCode/backend/pkg/tasker"
1819
)
1920

@@ -84,6 +85,12 @@ func WithSiteResolver(resolver domain.SiteResolver) BridgeOption {
8485
}
8586
}
8687

88+
func WithCaptcha(captcha *captcha.Captcha) BridgeOption {
89+
return func(i *do.Injector) {
90+
do.OverrideValue(i, captcha)
91+
}
92+
}
93+
8794
func Register(e *echo.Echo, dir string, opts ...BridgeOption) error {
8895
cfg, err := config.Init(dir)
8996
if err != nil {

0 commit comments

Comments
 (0)