@@ -26,7 +26,6 @@ import {
2626 enableUserControlledMfaWithTotpOnlyAtSignIn ,
2727} from '#src/helpers/sign-in-experience.js' ;
2828import { generateNewUserProfile , UserApiTest } from '#src/helpers/user.js' ;
29- import { devFeatureTest } from '#src/utils.js' ;
3029
3130describe ( 'Bind MFA APIs happy path' , ( ) => {
3231 const userApi = new UserApiTest ( ) ;
@@ -175,60 +174,57 @@ describe('Bind MFA APIs happy path', () => {
175174 await deleteUser ( userId ) ;
176175 } ) ;
177176
178- devFeatureTest . it (
179- 'should prompt again after resetting skip state via management API' ,
180- async ( ) => {
181- const { username, password } = generateNewUserProfile ( { username : true , password : true } ) ;
182- const client = await initExperienceClient ( {
183- interactionEvent : InteractionEvent . Register ,
184- } ) ;
185-
186- const { verificationId } = await client . createNewPasswordIdentityVerification ( {
187- identifier : {
188- type : SignInIdentifier . Username ,
189- value : username ,
190- } ,
191- password,
192- } ) ;
193-
194- await client . identifyUser ( { verificationId } ) ;
195-
196- await expectRejects ( client . submitInteraction ( ) , {
197- code : 'user.missing_mfa' ,
198- status : 422 ,
199- } ) ;
200-
201- await client . skipMfaBinding ( ) ;
202-
203- const { redirectTo } = await client . submitInteraction ( ) ;
204- const userId = await processSession ( client , redirectTo ) ;
205- await logoutClient ( client ) ;
206-
207- const skippedConfig = await getUserLogtoConfig ( userId ) ;
208- expect ( skippedConfig . mfa . skipped ) . toBe ( true ) ;
209-
210- await signInWithPassword ( {
211- identifier : {
212- type : SignInIdentifier . Username ,
213- value : username ,
214- } ,
215- password,
216- } ) ;
217-
218- await updateUserLogtoConfig ( userId , false ) ;
219- const resetConfig = await getUserLogtoConfig ( userId ) ;
220- expect ( resetConfig . mfa . skipped ) . toBe ( false ) ;
221-
222- const client2 = await initExperienceClient ( ) ;
223- await identifyUserWithUsernamePassword ( client2 , username , password ) ;
224- await expectRejects ( client2 . submitInteraction ( ) , {
225- code : 'user.missing_mfa' ,
226- status : 422 ,
227- } ) ;
228-
229- await deleteUser ( userId ) ;
230- }
231- ) ;
177+ it ( 'should prompt again after resetting skip state via management API' , async ( ) => {
178+ const { username, password } = generateNewUserProfile ( { username : true , password : true } ) ;
179+ const client = await initExperienceClient ( {
180+ interactionEvent : InteractionEvent . Register ,
181+ } ) ;
182+
183+ const { verificationId } = await client . createNewPasswordIdentityVerification ( {
184+ identifier : {
185+ type : SignInIdentifier . Username ,
186+ value : username ,
187+ } ,
188+ password,
189+ } ) ;
190+
191+ await client . identifyUser ( { verificationId } ) ;
192+
193+ await expectRejects ( client . submitInteraction ( ) , {
194+ code : 'user.missing_mfa' ,
195+ status : 422 ,
196+ } ) ;
197+
198+ await client . skipMfaBinding ( ) ;
199+
200+ const { redirectTo } = await client . submitInteraction ( ) ;
201+ const userId = await processSession ( client , redirectTo ) ;
202+ await logoutClient ( client ) ;
203+
204+ const skippedConfig = await getUserLogtoConfig ( userId ) ;
205+ expect ( skippedConfig . mfa . skipped ) . toBe ( true ) ;
206+
207+ await signInWithPassword ( {
208+ identifier : {
209+ type : SignInIdentifier . Username ,
210+ value : username ,
211+ } ,
212+ password,
213+ } ) ;
214+
215+ await updateUserLogtoConfig ( userId , false ) ;
216+ const resetConfig = await getUserLogtoConfig ( userId ) ;
217+ expect ( resetConfig . mfa . skipped ) . toBe ( false ) ;
218+
219+ const client2 = await initExperienceClient ( ) ;
220+ await identifyUserWithUsernamePassword ( client2 , username , password ) ;
221+ await expectRejects ( client2 . submitInteraction ( ) , {
222+ code : 'user.missing_mfa' ,
223+ status : 422 ,
224+ } ) ;
225+
226+ await deleteUser ( userId ) ;
227+ } ) ;
232228
233229 it ( 'should able to skip MFA binding on sign-in' , async ( ) => {
234230 const { username, password } = generateNewUserProfile ( { username : true , password : true } ) ;
0 commit comments