@@ -17,8 +17,8 @@ export default function contentstackClient ({ http }) {
17
17
* @param {Object } parameters - login parameters
18
18
* @prop {string } parameters.email - email id for user to login
19
19
* @prop {string } parameters.password - password for user to login
20
- * @prop {string } parameters.token - token for user to login (2FA token)
21
20
* @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
22
22
* @returns {Promise }
23
23
* @example
24
24
* import * as contentstack from '@contentstack/management'
@@ -27,17 +27,13 @@ export default function contentstackClient ({ http }) {
27
27
* client.login({ email: <emailid>, password: <password> })
28
28
* .then(() => console.log('Logged in successfully'))
29
29
*
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'))
41
37
*/
42
38
function login ( requestBody = { } , params = { } ) {
43
39
http . defaults . versioningStrategy = 'path'
0 commit comments