Skip to content

Commit 2bc6822

Browse files
committed
Replace incorrect TOTP fragment with InlineFilter
1 parent bd3e79a commit 2bc6822

File tree

2 files changed

+69
-93
lines changed

2 files changed

+69
-93
lines changed

src/fragments/lib/auth/android/signin_next_steps/91_confirm_totp_mfa.mdx

Lines changed: 0 additions & 91 deletions
This file was deleted.

src/fragments/lib/auth/common/mfa/flows.mdx

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,76 @@ import iosContinueSignInWithMFASelection from '/src/fragments/lib/auth/ios/signi
605605

606606
<Fragments fragments={{ swift: iosContinueSignInWithMFASelection }} />
607607

608-
import androidContinueSignInWithMFASelection from '/src/fragments/lib/auth/android/signin_next_steps/91_confirm_totp_mfa.mdx';
608+
<InlineFilter filters={['android']}>
609+
610+
<BlockSwitcher>
611+
<Block name="Java">
612+
613+
```java
614+
Amplify.Auth.confirmSignIn(
615+
MFATypeUtil.getChallengeResponse(MFAType.TOTP),
616+
result -> {
617+
if (result.getNextStep().getSignInStep() == AuthSignInStep.CONFIRM_SIGN_IN_WITH_TOTP_CODE) {
618+
Log.i("AuthQuickStart", "Received next step as confirm sign in with TOTP");
619+
}
620+
// ...
621+
},
622+
error -> Log.e("AuthQuickstart", "Confirm sign in failed: " + error)
623+
);
624+
```
625+
626+
</Block>
627+
<Block name="Kotlin - Callbacks">
628+
629+
```kotlin
630+
Amplify.Auth.confirmSignIn(
631+
MFAType.TOTP.challengeResponse,
632+
{ result ->
633+
if (result.nextStep.signInStep == AuthSignInStep.CONFIRM_SIGN_IN_WITH_TOTP_CODE) {
634+
Log.i("AuthQuickStart", "Received next step as confirm sign in with TOTP");
635+
}
636+
// ...
637+
},
638+
{ error -> Log.e("AuthQuickstart", "Confirm sign in failed: $error") }
639+
)
640+
```
641+
642+
</Block>
643+
<Block name="Kotlin - Coroutines">
609644

610-
<Fragments fragments={{ android: androidContinueSignInWithMFASelection }} />
645+
```kotlin
646+
try {
647+
val result = Amplify.Auth.confirmSignIn(MFAType.TOTP.challengeResponse)
648+
if (result.nextStep.signInStep == AuthSignInStep.CONFIRM_SIGN_IN_WITH_TOTP_CODE) {
649+
Log.i("AuthQuickStart", "Received next step as confirm sign in with TOTP");
650+
}
651+
// ...
652+
} catch(error: Exception) {
653+
Log.e("AuthQuickstart", "Confirm sign in failed: $error")
654+
}
655+
```
656+
657+
</Block>
658+
<Block name="RxJava">
659+
660+
```java
661+
RxAmplify.Auth.confirmSignIn(
662+
MFATypeUtil.getChallengeResponse(MFAType.TOTP)
663+
).subscribe(
664+
result -> {
665+
if (result.getNextStep().getSignInStep() == AuthSignInStep.CONFIRM_SIGN_IN_WITH_TOTP_CODE) {
666+
Log.i("AuthQuickStart", "Received next step as confirm sign in with TOTP");
667+
}
668+
// ...
669+
},
670+
error -> Log.e("AuthQuickstart", "Confirm sign in failed: " + error)
671+
);
672+
```
673+
674+
</Block>
675+
</BlockSwitcher>
676+
677+
</InlineFilter>
611678

612679
<InlineFilter filters={['flutter']}>
613680

0 commit comments

Comments
 (0)