Unknown 10 年之前
父節點
當前提交
9d2cef23f2
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      modules/auth/user.go

+ 5 - 1
modules/auth/user.go

@@ -25,7 +25,11 @@ func SignedInId(header http.Header, sess session.SessionStore) int64 {
 		return 0
 	}
 
-	id, _ := base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64()
+	var id int64
+	if setting.Service.EnableReverseProxyAuth {
+		id, _ = base.StrTo(header.Get(setting.ReverseProxyAuthUid)).Int64()
+	}
+
 	if id <= 0 {
 		uid := sess.Get("userId")
 		if uid == nil {