diff --git a/example/test.js b/example/test.js index c6e253f..bafb3b1 100644 --- a/example/test.js +++ b/example/test.js @@ -8,7 +8,7 @@ let smart_api = new SmartAPI({ }); // If user does not have valid access token and refresh token then use generateSession method -smart_api.generateSession("CLIENT_CODE", "PASSWORD") +smart_api.generateSession("CLIENT_CODE", "PASSWORD", "TOTP") .then((data) => { console.log(data) // return smart_api.getProfile() diff --git a/lib/smartapi-connect.js b/lib/smartapi-connect.js index 7df5cc1..6cd4c4b 100644 --- a/lib/smartapi-connect.js +++ b/lib/smartapi-connect.js @@ -145,10 +145,11 @@ var SmartApi = function (params) { * @param {string} clientcode * @param {string} password */ - self.generateSession = function (client_code, password) { + self.generateSession = function (client_code, password, totp) { let params = { "clientcode": client_code, - "password": password + "password": password, + "totp": totp } let token_data = post_request("user_login", params);