mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixing the decryption issue during restoring the connection on restart.
As we convert the binary password to string during storing the connection information, we also need to convert it back to byte-arrays during restoring the connections. Hence - decode the passowrd using 'utf-8' encoding during storing the connection information, and encode it during restoring the connections.
This commit is contained in:
parent
7f1e57c2a6
commit
37e2e1d24b
@ -1049,7 +1049,7 @@ class ServerManager(object):
|
||||
|
||||
res = dict()
|
||||
res['sid'] = self.sid
|
||||
res['password'] = str(self.password)
|
||||
res['password'] = self.password.decode('utf-8')
|
||||
|
||||
connections = res['connections'] = dict()
|
||||
|
||||
@ -1151,6 +1151,10 @@ WHERE db.oid = {0}""".format(did))
|
||||
# first connection for identifications.
|
||||
from pgadmin.browser.server_groups.servers.types import ServerType
|
||||
self.pinged = datetime.datetime.now()
|
||||
try:
|
||||
data['password'] = data['password'].encode('utf-8')
|
||||
except:
|
||||
pass
|
||||
|
||||
connections = data['connections']
|
||||
for conn_id in connections:
|
||||
|
Loading…
Reference in New Issue
Block a user