Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 访问授权码输入错误 3 次后加入验证码 https://github.com/siyuan-note/siyuan/issues/5429

Liang Dinga32e2eb1c019
diff --git a/kernel/model/session.go b/kernel/model/session.go
index 7804ed3f26..1058489679 100644
--- a/kernel/model/session.go
+++ b/kernel/model/session.go
@@ -71,7 +71,7 @@ func LoginAuth(c *gin.Context) {
}
inputCaptcha = captchaArg.(string)
- if session.Captcha != inputCaptcha {
+ if strings.ToLower(session.Captcha) != strings.ToLower(inputCaptcha) {
ret.Code = 1
ret.Msg = Conf.Language(22)
return
@@ -109,10 +109,9 @@ func LoginAuth(c *gin.Context) {
func GetCaptcha(c *gin.Context) {
img, err := captcha.New(100, 26, func(options *captcha.Options) {
- options.CharPreset = "abcdefghjkmnpqrtuvwxyz2346789"
+ options.CharPreset = "ABCDEFGHKLMNPQRSTUVWXYZ23456789"
options.Noise = 0.5
options.CurveNumber = 0
- options.FontScale = 1.2
})
if nil != err {
util.LogErrorf("generates captcha failed: " + err.Error())