mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 改进多工作空间鉴权
This commit is contained in:
@@ -364,13 +364,14 @@ func serveWebSocket(ginServer *gin.Engine) {
|
||||
if nil == val {
|
||||
authOk = false
|
||||
} else {
|
||||
sess := map[string]interface{}{}
|
||||
err = gulu.JSON.UnmarshalJSON([]byte(val.(string)), &sess)
|
||||
sess := &util.SessionData{}
|
||||
err = gulu.JSON.UnmarshalJSON([]byte(val.(string)), sess)
|
||||
if nil != err {
|
||||
authOk = false
|
||||
logging.LogErrorf("unmarshal cookie failed: %s", err)
|
||||
} else {
|
||||
authOk = sess["AccessAuthCode"].(string) == model.Conf.AccessAuthCode
|
||||
workspaceSess := util.GetWorkspaceSession(sess)
|
||||
authOk = workspaceSess.AccessAuthCode == model.Conf.AccessAuthCode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user