Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions lib/smartapi-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down