mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🐛 浏览器端开启访问鉴权后文档更新未保存 Fix https://github.com/siyuan-note/siyuan/issues/5096
This commit is contained in:
parent
dce2ddca6a
commit
8b0f3d70d9
6 changed files with 16 additions and 5 deletions
|
|
@ -140,6 +140,12 @@ func CheckAuth(c *gin.Context) {
|
|||
if session.AccessAuthCode != Conf.AccessAuthCode {
|
||||
userAgentHeader := c.GetHeader("User-Agent")
|
||||
if strings.HasPrefix(userAgentHeader, "SiYuan/") || strings.HasPrefix(userAgentHeader, "Mozilla/") {
|
||||
if "GET" != c.Request.Method {
|
||||
c.JSON(401, map[string]interface{}{"code": -1, "msg": Conf.Language(156)})
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
c.Redirect(302, "/check-auth")
|
||||
c.Abort()
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue