You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/06/29 13:03:32 UTC

[iotdb] branch rel/0.13 updated: strength login check. (#6514)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.13 by this push:
     new 5f03723ff0 strength login check. (#6514)
5f03723ff0 is described below

commit 5f03723ff0c940ec68cfc53a0c491ceba80d2417
Author: ZhangHongYin <46...@users.noreply.github.com>
AuthorDate: Wed Jun 29 21:03:27 2022 +0800

    strength login check. (#6514)
---
 .../main/java/org/apache/iotdb/db/service/basic/ServiceProvider.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/basic/ServiceProvider.java b/server/src/main/java/org/apache/iotdb/db/service/basic/ServiceProvider.java
index d71e54e128..987acbc6d7 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/basic/ServiceProvider.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/basic/ServiceProvider.java
@@ -105,7 +105,8 @@ public abstract class ServiceProvider {
    * @return true: If logged in; false: If not logged in
    */
   public boolean checkLogin(long sessionId) {
-    boolean isLoggedIn = SESSION_MANAGER.getUsername(sessionId) != null;
+    Long currSessionId = SESSION_MANAGER.getCurrSessionId();
+    boolean isLoggedIn = currSessionId != null && currSessionId == sessionId;
     if (!isLoggedIn) {
       LOGGER.info("{}: Not login. ", IoTDBConstant.GLOBAL_DB_NAME);
     } else {