Skip to content

Commit ee6c1b6

Browse files
committed
Removed the token and added examples
1 parent 8fff7fc commit ee6c1b6

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fileignoreconfig:
2727
- filename: test/sanity-check/api/bulkOperation-test.js
2828
checksum: f40a14c84ab9a194aaf830ca68e14afde2ef83496a07d4a6393d7e0bed15fb0e
2929
- filename: lib/contentstackClient.js
30-
checksum: b61fcf4fea88b8328ffa9d29a1ed88fe23ee9c9ef0cbd458721dcb7c82d2432b
30+
checksum: b76ca091caa3a1b2658cd422a2d8ef3ac9996aea0aff3f982d56bb309a3d9fde
3131
- filename: test/unit/ContentstackClient-test.js
3232
checksum: e712b74f37ea15afd2ac095fc2154f8c9f2ffe955659e77651da4a0d7079ec88
3333
version: "1.0"

lib/contentstackClient.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export default function contentstackClient ({ http }) {
1717
* @param {Object} parameters - login parameters
1818
* @prop {string} parameters.email - email id for user to login
1919
* @prop {string} parameters.password - password for user to login
20-
* @prop {string} parameters.token - token for user to login (2FA token)
2120
* @prop {string} parameters.tfa_token - tfa token for user to login (2FA token)
21+
* @prop {string} parameters.mfaSecret - TOTP secret key for generating 2FA token
2222
* @returns {Promise}
2323
* @example
2424
* import * as contentstack from '@contentstack/management'
@@ -27,17 +27,13 @@ export default function contentstackClient ({ http }) {
2727
* client.login({ email: <emailid>, password: <password> })
2828
* .then(() => console.log('Logged in successfully'))
2929
*
30-
*/
31-
/**
32-
* Login function that supports both regular login and TOTP-based 2FA
33-
* @param {Object} requestBody - Login credentials
34-
* @param {string} requestBody.email - Email address
35-
* @param {string} requestBody.password - Password
36-
* @param {string} [requestBody.tfa_token] - 2FA Token
37-
* @param {string} [requestBody.mfaSecret] - TOTP secret key for generating 2FA token
38-
* @param {string} [requestBody.token] - token for user to login
39-
* @param {Object} params - Additional parameters
40-
* @returns {Promise}
30+
* @example
31+
* client.login({ email: <emailid>, password: <password>, tfa_token: <tfa_token> })
32+
* .then(() => console.log('Logged in successfully'))
33+
*
34+
* @example
35+
* client.login({ email: <emailid>, password: <password>, mfaSecret: <mfa_secret> })
36+
* .then(() => console.log('Logged in successfully'))
4137
*/
4238
function login (requestBody = {}, params = {}) {
4339
http.defaults.versioningStrategy = 'path'

types/contentstackClient.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export interface ContentstackConfig extends AxiosRequestConfig, ContentstackToke
5050
export interface LoginDetails {
5151
email: string,
5252
password: string,
53-
token?: string
5453
tfa_token?: string
5554
mfaSecret?: string
5655
}

0 commit comments

Comments
 (0)