mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Returns an error when the driver couldn't decrypt the password, and
let the user know the issue.
This commit is contained in:
@@ -102,7 +102,15 @@ class Connection(BaseConnection):
|
|||||||
if user is None:
|
if user is None:
|
||||||
return False, gettext("Unauthorized Request.")
|
return False, gettext("Unauthorized Request.")
|
||||||
|
|
||||||
password = decrypt(encpass, user.password)
|
try:
|
||||||
|
password = decrypt(encpass, user.password)
|
||||||
|
except Exception as e:
|
||||||
|
current_app.logger.exception(e)
|
||||||
|
return False, \
|
||||||
|
_("Failed to decrypt the saved password!\nError: {0}").format(
|
||||||
|
str(e)
|
||||||
|
)
|
||||||
|
|
||||||
# password is in bytes, for python3 we need it in string
|
# password is in bytes, for python3 we need it in string
|
||||||
if isinstance(password, bytes):
|
if isinstance(password, bytes):
|
||||||
password = password.decode()
|
password = password.decode()
|
||||||
|
|||||||
Reference in New Issue
Block a user