mirror of
https://github.com/plantroon/mx-puppet-xmpp.git
synced 2024-12-22 14:41:51 +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,
|
||||
} as IRetData;
|
||||
const [username, password] = str.split(" ");
|
||||
const data: any = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
try {
|
||||
const client = new Client(username, password);
|
||||
await client.connect();
|
||||
data.state = client.getState;
|
||||
await client.disconnect();
|
||||
} catch (err) {
|
||||
retData.error = "Username or password wrong";
|
||||
return retData;
|
||||
}
|
||||
retData.success = true;
|
||||
const data: any = {
|
||||
username,
|
||||
password,
|
||||
};
|
||||
retData.data = data;
|
||||
return retData;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user