mirror of
https://github.com/plantroon/mx-puppet-xmpp.git
synced 2024-11-05 11:21:41 +00:00
already store state on initial test-login
This commit is contained in:
parent
7a5b6f985b
commit
19020890e1
@ -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;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user