mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 02:09:10 +08:00
🎨 Improve access auth code setting
This commit is contained in:
parent
048139d91c
commit
4b4366268b
@ -564,6 +564,9 @@ func setAccessAuthCode(c *gin.Context) {
|
||||
aac = model.Conf.AccessAuthCode
|
||||
}
|
||||
|
||||
aac = strings.TrimSpace(aac)
|
||||
aac = util.RemoveInvalid(aac)
|
||||
|
||||
model.Conf.AccessAuthCode = aac
|
||||
model.Conf.Save()
|
||||
|
||||
|
@ -96,6 +96,9 @@ func LoginAuth(c *gin.Context) {
|
||||
}
|
||||
|
||||
authCode := arg["authCode"].(string)
|
||||
authCode = strings.TrimSpace(authCode)
|
||||
authCode = util.RemoveInvalid(authCode)
|
||||
|
||||
if Conf.AccessAuthCode != authCode {
|
||||
ret.Code = -1
|
||||
ret.Msg = Conf.Language(83)
|
||||
@ -437,7 +440,6 @@ func ControlConcurrency(c *gin.Context) {
|
||||
strings.HasPrefix(reqPath, "/appearance/") ||
|
||||
strings.HasPrefix(reqPath, "/export/") ||
|
||||
strings.HasPrefix(reqPath, "/history/") ||
|
||||
|
||||
strings.HasPrefix(reqPath, "/api/query/") ||
|
||||
strings.HasPrefix(reqPath, "/api/search/") ||
|
||||
strings.HasPrefix(reqPath, "/api/network/") ||
|
||||
|
Loading…
Reference in New Issue
Block a user