From 19020890e1a1677321518f80bdddd905665b89c0 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Tue, 24 Mar 2020 22:40:18 +0100 Subject: [PATCH] already store state on initial test-login --- src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index f1eabb0..376f014 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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; });