Skip to content

Commit

Permalink
Fixed the error occurring during logout from pgadmin when using OAuth…
Browse files Browse the repository at this point in the history
…2 authnecation with query tool open.pgadmin-org#8299
  • Loading branch information
yogeshmahajan-1903 committed Jan 22, 2025
1 parent 133a59c commit 638e268
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion web/pgadmin/authenticate/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ def oauth_logout():

if not current_user.is_authenticated:
return redirect(get_safe_post_logout_redirect())

# Logout the user first to avoid crypt key issue while
# cancelling existing query tool transactions
logout_user()
for key in list(session.keys()):
session.pop(key)

logout_user()
if logout_url:
return redirect(logout_url.format(
redirect_uri=request.url_root,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def before(self):
# For this test case we need to set "Insert bracket pairs?"
# SQL Editor preference to 'false' to avoid codemirror
# to add matching closing bracket by it self.
self._update_preferences()
# self._update_preferences()

# close the db connection
connection.close()
Expand Down
4 changes: 3 additions & 1 deletion web/regression/feature_utils/locators.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ class NavMenuLocators:

specified_sub_node_of_pref_tree_node = \
"//*[@id='treeContainer']//div//span[text()='{1}']"

insert_bracket_pair_switch_btn = \
"//label[text()='Insert bracket pairs?']//following::div[1]//span"
("//div[label[text()='Insert bracket pairs?']]/"
"following-sibling::div//input")

copy_sql_to_query_tool_switch_btn = \
"//label[text()='Copy SQL from main window to query tool?']" \
Expand Down

0 comments on commit 638e268

Please sign in to comment.