@@ -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'
0 commit comments