@@ -34,7 +34,7 @@ describe('Contentstack Client', () => {
3434 } )
3535 . catch ( done )
3636 } )
37-
37+ // Thi
3838 it ( 'Contentstack Client get user info' , done => {
3939 var mock = new MockAdapter ( axios )
4040 mock . onGet ( '/user' ) . reply ( 200 , {
@@ -215,7 +215,7 @@ describe('Contentstack Client', () => {
215215 expect ( data . user ) . to . deep . equal ( {
216216217217 password : 'password123' ,
218- tfa_token : '654321 '
218+ tfa_token : '123456 '
219219 } )
220220 return [ 200 , {
221221 user : {
@@ -229,7 +229,7 @@ describe('Contentstack Client', () => {
229229 . login ( {
230230231231 password : 'password123' ,
232- tfa_token : '654321 '
232+ tfa_token : '123456 '
233233 } )
234234 . then ( response => {
235235 expect ( response . user . authtoken ) . to . equal ( 'Test Auth With TFA' )
@@ -240,7 +240,7 @@ describe('Contentstack Client', () => {
240240 } )
241241
242242 it ( 'should handle login with TOTP secret' , done => {
243- const mfaSecret = 'JBSWY3DPEHPK3PXP '
243+ const mfaSecret = 'MFASECRET '
244244
245245 mock . onPost ( '/user-session' ) . reply ( config => {
246246 const data = JSON . parse ( config . data )
@@ -278,7 +278,7 @@ describe('Contentstack Client', () => {
278278 expect ( data . user ) . to . deep . equal ( {
279279280280 password : 'password123' ,
281- tfa_token : '654321' // Should use this directly instead of generating from mfaSecret
281+ tfa_token : '123456'
282282 } )
283283 return [ 200 , {
284284 user : {
@@ -292,8 +292,8 @@ describe('Contentstack Client', () => {
292292 . login ( {
293293294294 password : 'password123' ,
295- tfa_token : '654321 ' ,
296- mfaSecret : 'JBSWY3DPEHPK3PXP' // This should be ignored
295+ tfa_token : '123456 ' ,
296+ mfaSecret : 'MFASECRET'
297297 } )
298298 . then ( response => {
299299 expect ( response . user . authtoken ) . to . equal ( 'Test Auth Direct TFA' )
@@ -374,7 +374,7 @@ describe('Contentstack Client', () => {
374374 expect ( data . user ) . to . deep . equal ( {
375375376376 password : 'password123' ,
377- tfa_token : '123456' // Should use provided tfa_token, not generate from mfaSecret
377+ tfa_token : '123456'
378378 } )
379379 return [ 200 , {
380380 user : {
@@ -389,7 +389,7 @@ describe('Contentstack Client', () => {
389389390390 password : 'password123' ,
391391 tfa_token : '123456' ,
392- mfaSecret : 'JBSWY3DPEHPK3PXP' // This should be ignored
392+ mfaSecret : 'MFASECRET'
393393 } )
394394 . then ( response => {
395395 expect ( response . user . authtoken ) . to . equal ( 'Test Auth' )
@@ -404,8 +404,8 @@ describe('Contentstack Client', () => {
404404 const data = JSON . parse ( config . data )
405405 expect ( data . user . email ) . to . equal ( '[email protected] ' ) 406406 expect ( data . user . password ) . to . equal ( 'password123' )
407- expect ( data . user . tfa_token ) . to . match ( / ^ \d { 6 } $ / ) // Should be 6-digit number
408- expect ( data . user . mfaSecret ) . to . equal ( undefined ) // Should not be in request
407+ expect ( data . user . tfa_token ) . to . match ( / ^ \d { 6 } $ / )
408+ expect ( data . user . mfaSecret ) . to . equal ( undefined )
409409 return [ 200 , {
410410 user : {
411411 authtoken : 'Test Auth' ,
@@ -418,7 +418,7 @@ describe('Contentstack Client', () => {
418418 . login ( {
419419420420 password : 'password123' ,
421- mfaSecret : 'JBSWY3DPEHPK3PXP '
421+ mfaSecret : 'MFASECRET '
422422 } )
423423 . then ( response => {
424424 expect ( response . user . authtoken ) . to . equal ( 'Test Auth' )
0 commit comments