Skip to content

Commit

Permalink
Allow script name URLs in the next URL of the login page.
Browse files Browse the repository at this point in the history
refs #5343
  • Loading branch information
adityatoshniwal authored and akshay-joshi committed Sep 20, 2022
1 parent 2b00480 commit 4d9dfe7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions web/pgadmin/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,12 @@ def get_safe_post_login_redirect():
allow_list = [
url_for('browser.index')
]
if "SCRIPT_NAME" in os.environ and os.environ["SCRIPT_NAME"]:
allow_list.append(os.environ["SCRIPT_NAME"])

url = get_post_login_redirect()
if url in allow_list:
return url
for item in allow_list:
if url.startswith(item):
return url

return "/"
return os.environ.get("SCRIPT_NAME", "/")

0 comments on commit 4d9dfe7

Please sign in to comment.