already store state on initial test-login

This commit is contained in:
Sorunome 2020-03-24 22:40:18 +01:00
parent 7a5b6f985b
commit 19020890e1
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C

View File

@ -116,19 +116,20 @@ async function run() {
success: false, success: false,
} as IRetData; } as IRetData;
const [username, password] = str.split(" "); const [username, password] = str.split(" ");
const data: any = {
username,
password,
};
try { try {
const client = new Client(username, password); const client = new Client(username, password);
await client.connect(); await client.connect();
data.state = client.getState;
await client.disconnect(); await client.disconnect();
} catch (err) { } catch (err) {
retData.error = "Username or password wrong"; retData.error = "Username or password wrong";
return retData; return retData;
} }
retData.success = true; retData.success = true;
const data: any = {
username,
password,
};
retData.data = data; retData.data = data;
return retData; return retData;
}); });