Skip to content

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

:art: Improve response details for auth check https://ld246.com/article/1711591523782

Daniel8540113527a1
diff --git a/kernel/model/session.go b/kernel/model/session.go
index 80dbdcd9f4..d3d80dc264 100644
--- a/kernel/model/session.go
+++ b/kernel/model/session.go
@@ -242,7 +242,7 @@ func CheckAuth(c *gin.Context) {
return
}
- c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed"})
+ c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [header: Authorization]"})
c.Abort()
return
}
@@ -255,7 +255,7 @@ func CheckAuth(c *gin.Context) {
return
}
- c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed"})
+ c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [query: token]"})
c.Abort()
return
}
@@ -285,7 +285,7 @@ func CheckAuth(c *gin.Context) {
return
}
- c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed"})
+ c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [session]"})
c.Abort()
return
}