Skip to content

Commit

Permalink
log in different devices with the same username in the same session
Browse files Browse the repository at this point in the history
  • Loading branch information
feyruzb committed Sep 26, 2024
1 parent afb9323 commit c99d550
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/server/codechecker_server/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,11 @@ def create_session_oauth(self, provider, username, token):
if not self.__is_method_enabled('oauth'):
return False

# Try to get the user's previous session.
for sess in self.__sessions:
if sess.user == username:
return sess

providers = self.__auth_config.get(
'method_oauth', {}).get("providers", {})

Expand Down Expand Up @@ -714,11 +719,6 @@ def create_session_oauth(self, provider, username, token):
try:
transaction = self.__database_connection()

# Remove previous session that may exist for the user.
transaction.query(SessionRecord) \
.filter(SessionRecord.user_name == user_data.get('username')) \
.delete()

# Store the new session.
record = SessionRecord(token,
user_data.get('username'),
Expand Down

0 comments on commit c99d550

Please sign in to comment.