Fixed intermittent error shown while OAuth2 login

This commit is contained in:
Yogesh Mahajan 2022-09-23 13:58:02 +05:30 committed by GitHub
parent 9a6516a8b3
commit f052ecffc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -25,6 +25,7 @@ Housekeeping
Bug fixes
*********
| `Issue #5145 <https://github.com/pgadmin-org/pgadmin4/issues/5145>`_ - Fixed intermittent error shown while OAuth2 login.
| `Issue #5188 <https://github.com/pgadmin-org/pgadmin4/issues/5188>`_ - Ensure that the continue/start button should be disabled if the user stops the Debugger for the procedures.
| `Issue #5210 <https://github.com/pgadmin-org/pgadmin4/issues/5210>`_ - Ensure that the query tool creates a new tab with the appropriate user when pressing Alt+Shift+Q.
| `Issue #5249 <https://github.com/pgadmin-org/pgadmin4/issues/5249>`_ - Added the ability to display the selected text from the query tool in the find/replace box.

View File

@ -67,12 +67,15 @@ def login():
The user input will be validated and authenticated.
"""
form = _security.login_form()
auth_obj = AuthSourceManager(form, copy.deepcopy(
config.AUTHENTICATION_SOURCES))
if OAUTH2 in config.AUTHENTICATION_SOURCES \
and 'oauth2_button' in request.form:
# Sending empty form as oauth2 does not require form attribute
auth_obj = AuthSourceManager({}, copy.deepcopy(
config.AUTHENTICATION_SOURCES))
session['auth_obj'] = auth_obj
else:
auth_obj = AuthSourceManager(form, copy.deepcopy(
config.AUTHENTICATION_SOURCES))
session['auth_source_manager'] = None