🐛 Authentication middleware compatible (#9720)

This commit is contained in:
Yingyi / 颖逸 2023-11-22 16:55:44 +08:00 committed by GitHub
parent 1e9a00a039
commit f38c52292b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 5 deletions

View file

@ -162,6 +162,12 @@ func CheckAuth(c *gin.Context) {
// 未设置访问授权码
if "" == Conf.AccessAuthCode {
// Skip the empty access authorization code check https://github.com/siyuan-note/siyuan/issues/9709
if util.SIYUAN_ACCESS_AUTH_CODE_BYPASS {
c.Next()
return
}
// Authenticate requests with the Origin header other than 127.0.0.1 https://github.com/siyuan-note/siyuan/issues/9180
clientIP := c.ClientIP()
host := c.GetHeader("Host")