public inbox for [email protected]
help / color / mirror / Atom feedFrom: Khushboo Vashi <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch] - RM 6513 - pgAdmin server mode does not open after password reset.
Date: Thu, 10 Jun 2021 14:18:59 +0530
Message-ID: <CAFOhELcfHuwDMh0xT81iE2an91bWKzG_6eYzuUbnXzLDf9OMgA@mail.gmail.com> (raw)
Hi,
Please find the attached patch to fix the RM 6513 - pgAdmin server mode
does not open after password reset.
Thanks,
Khushboo
Attachments:
[application/octet-stream] forgot_password.patch (1.8K, 3-forgot_password.patch)
download | inline diff:
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
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [pgAdmin4][Patch] - RM 6513 - pgAdmin server mode does not open after password reset.
In-Reply-To: <CAFOhELcfHuwDMh0xT81iE2an91bWKzG_6eYzuUbnXzLDf9OMgA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox