mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where a warning is flashed every time for an email address when
authentication sources are internal and ldap. Fixes #6999
This commit is contained in:
committed by
Akshay Joshi
parent
b1221d5517
commit
b539637426
@@ -20,6 +20,7 @@ Housekeeping
|
|||||||
Bug fixes
|
Bug fixes
|
||||||
*********
|
*********
|
||||||
|
|
||||||
|
| `Issue #6999 <https://redmine.postgresql.org/issues/6999>`_ - Fixed an issue where a warning is flashed every time for an email address when authentication sources are internal and ldap.
|
||||||
| `Issue #7124 <https://redmine.postgresql.org/issues/7124>`_ - Fixed the schema diff issue where tables have different column positions and a column has a default value.
|
| `Issue #7124 <https://redmine.postgresql.org/issues/7124>`_ - Fixed the schema diff issue where tables have different column positions and a column has a default value.
|
||||||
| `Issue #7152 <https://redmine.postgresql.org/issues/7152>`_ - Added comments column for the functions collection node.
|
| `Issue #7152 <https://redmine.postgresql.org/issues/7152>`_ - Added comments column for the functions collection node.
|
||||||
| `Issue #7173 <https://redmine.postgresql.org/issues/7173>`_ - Fixed an issue where the User Management dialog is not opening.
|
| `Issue #7173 <https://redmine.postgresql.org/issues/7173>`_ - Fixed an issue where the User Management dialog is not opening.
|
||||||
|
|||||||
@@ -211,10 +211,14 @@ class AuthSourceManager:
|
|||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
"""Validate through all the sources."""
|
"""Validate through all the sources."""
|
||||||
|
err_msg = None
|
||||||
for src in self.auth_sources:
|
for src in self.auth_sources:
|
||||||
source = get_auth_sources(src)
|
source = get_auth_sources(src)
|
||||||
if source.validate(self.form):
|
status, err_msg = source.validate(self.form)
|
||||||
|
if status:
|
||||||
return True
|
return True
|
||||||
|
if err_msg:
|
||||||
|
flash(err_msg, 'warning')
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def authenticate(self):
|
def authenticate(self):
|
||||||
|
|||||||
@@ -54,14 +54,14 @@ class BaseAuthentication(object):
|
|||||||
form.email.errors = list(form.email.errors)
|
form.email.errors = list(form.email.errors)
|
||||||
form.email.errors.append(gettext(
|
form.email.errors.append(gettext(
|
||||||
self.messages('EMAIL_NOT_PROVIDED')))
|
self.messages('EMAIL_NOT_PROVIDED')))
|
||||||
return False
|
return False, None
|
||||||
if password is None or password == '':
|
if password is None or password == '':
|
||||||
form.password.errors = list(form.password.errors)
|
form.password.errors = list(form.password.errors)
|
||||||
form.password.errors.append(
|
form.password.errors.append(
|
||||||
self.messages('PASSWORD_NOT_PROVIDED'))
|
self.messages('PASSWORD_NOT_PROVIDED'))
|
||||||
return False
|
return False, None
|
||||||
|
|
||||||
return True
|
return True, None
|
||||||
|
|
||||||
def login(self, form):
|
def login(self, form):
|
||||||
username = form.data['email']
|
username = form.data['email']
|
||||||
@@ -99,10 +99,10 @@ class InternalAuthentication(BaseAuthentication):
|
|||||||
"""User validation"""
|
"""User validation"""
|
||||||
# validate the email id first
|
# validate the email id first
|
||||||
if not validate_email(form.data['email']):
|
if not validate_email(form.data['email']):
|
||||||
flash(self.messages('INVALID_EMAIL'), 'warning')
|
return False, self.messages('INVALID_EMAIL')
|
||||||
return False
|
|
||||||
# Flask security validation
|
# Flask security validation
|
||||||
return form.validate_on_submit()
|
submit = form.validate_on_submit()
|
||||||
|
return submit, None
|
||||||
|
|
||||||
def authenticate(self, form):
|
def authenticate(self, form):
|
||||||
username = form.data['email']
|
username = form.data['email']
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class KerberosAuthentication(BaseAuthentication):
|
|||||||
return gettext("kerberos")
|
return gettext("kerberos")
|
||||||
|
|
||||||
def validate(self, form):
|
def validate(self, form):
|
||||||
return True
|
return True, None
|
||||||
|
|
||||||
def authenticate(self, frm):
|
def authenticate(self, frm):
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ class OAuth2Authentication(BaseAuthentication):
|
|||||||
return self.oauth2_config[self.oauth2_current_client]['OAUTH2_NAME']
|
return self.oauth2_config[self.oauth2_current_client]['OAUTH2_NAME']
|
||||||
|
|
||||||
def validate(self, form):
|
def validate(self, form):
|
||||||
return True
|
return True, None
|
||||||
|
|
||||||
def login(self, form):
|
def login(self, form):
|
||||||
profile = self.get_user_profile()
|
profile = self.get_user_profile()
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class WebserverAuthentication(BaseAuthentication):
|
|||||||
return gettext("webserver")
|
return gettext("webserver")
|
||||||
|
|
||||||
def validate(self, form):
|
def validate(self, form):
|
||||||
return True
|
return True, None
|
||||||
|
|
||||||
def get_user(self):
|
def get_user(self):
|
||||||
username = request.environ.get(config.WEBSERVER_REMOTE_USER)
|
username = request.environ.get(config.WEBSERVER_REMOTE_USER)
|
||||||
|
|||||||
Reference in New Issue
Block a user