Store and verify connection parameters
This commit is contained in:
@ -159,7 +159,11 @@ Client.fromCookie = async function(secret, host='vista.northport.med.va.gov', po
|
||||
console.log('Using saved secret and connection', secret);
|
||||
var cid = cookie.get('cid');
|
||||
var client = Client.fromID(cid, secret);
|
||||
if((await vista.call(cid, 'XWB_IM_HERE')).result == '1') return client;
|
||||
if((await vista.call(cid, 'XWB_IM_HERE')).result == '1') {
|
||||
var server = await client.serverinfo();
|
||||
if((host == server.result.host) && (port == server.result.port)) return client;
|
||||
else console.log('Rejecting previous connection to different server', server);
|
||||
}
|
||||
cookie.reset('cid');
|
||||
return await Client.fromCookie(secret, host, port);
|
||||
}
|
||||
|
Reference in New Issue
Block a user