Fixed an issue where pgAdmin does not open after password reset in server mode. Fixes #6513

This commit is contained in:
Khushboo Vashi 2021-06-10 22:55:31 +05:30 committed by Akshay Joshi
parent c86a2b643a
commit 460fb7ec29
3 changed files with 7 additions and 2 deletions

View File

@ -34,3 +34,4 @@ Bug fixes
| `Issue #6466 <https://redmine.postgresql.org/issues/6466>`_ - Ensure that the user should be able to add members in Login/Role group while creating it.
| `Issue #6478 <https://redmine.postgresql.org/issues/6478>`_ - Fixed duplicate SQL issue for tables with more than one partition.
| `Issue #6482 <https://redmine.postgresql.org/issues/6482>`_ - Fixed an issue where the Foreground Color property of server dialog does not work.
| `Issue #6513 <https://redmine.postgresql.org/issues/6513>`_ - Fixed an issue where pgAdmin does not open after password reset in server mode.

View File

@ -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):

View File

@ -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