From 460fb7ec29ae5b85d2a2307580190726ee522f79 Mon Sep 17 00:00:00 2001 From: Khushboo Vashi Date: Thu, 10 Jun 2021 22:55:31 +0530 Subject: [PATCH] Fixed an issue where pgAdmin does not open after password reset in server mode. Fixes #6513 --- docs/en_US/release_notes_5_4.rst | 1 + web/pgadmin/authenticate/__init__.py | 4 ++-- web/pgadmin/browser/__init__.py | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_5_4.rst b/docs/en_US/release_notes_5_4.rst index 2426d127a..8956abfec 100644 --- a/docs/en_US/release_notes_5_4.rst +++ b/docs/en_US/release_notes_5_4.rst @@ -34,3 +34,4 @@ Bug fixes | `Issue #6466 `_ - Ensure that the user should be able to add members in Login/Role group while creating it. | `Issue #6478 `_ - Fixed duplicate SQL issue for tables with more than one partition. | `Issue #6482 `_ - Fixed an issue where the Foreground Color property of server dialog does not work. +| `Issue #6513 `_ - Fixed an issue where pgAdmin does not open after password reset in server mode. diff --git a/web/pgadmin/authenticate/__init__.py b/web/pgadmin/authenticate/__init__.py index 40c76b2b3..d328b0d24 100644 --- a/web/pgadmin/authenticate/__init__.py +++ b/web/pgadmin/authenticate/__init__.py @@ -25,7 +25,7 @@ from flask import session import config from pgadmin.utils import PgAdminModule -from pgadmin.utils.constants import KERBEROS +from pgadmin.utils.constants import KERBEROS, INTERNAL from pgadmin.utils.csrf import pgCSRFProtect from .registry import AuthSourceRegistry @@ -120,7 +120,7 @@ class AuthSourceManager(): self.form = form self.auth_sources = sources self.source = None - self.source_friendly_name = None + self.source_friendly_name = INTERNAL self.current_source = None def as_dict(self): diff --git a/web/pgadmin/browser/__init__.py b/web/pgadmin/browser/__init__.py index fdfcdbde0..e91a72a57 100644 --- a/web/pgadmin/browser/__init__.py +++ b/web/pgadmin/browser/__init__.py @@ -51,6 +51,7 @@ from pgadmin.utils.master_password import validate_master_password, \ from pgadmin.model import User from pgadmin.utils.constants import MIMETYPE_APP_JS, PGADMIN_NODE,\ INTERNAL, KERBEROS, LDAP, QT_DEFAULT_PLACEHOLDER +from pgadmin.authenticate import AuthSourceManager try: from flask_security.views import default_render_json @@ -1326,6 +1327,9 @@ if hasattr(config, 'SECURITY_RECOVERABLE') and config.SECURITY_RECOVERABLE: if not has_error: after_this_request(view_commit) + auth_obj = AuthSourceManager(form, [INTERNAL]) + session['_auth_source_manager_obj'] = auth_obj.as_dict() + do_flash(*get_message('PASSWORD_RESET')) login_user(user) return redirect(get_url(_security.post_reset_view) or