Skip to content

Commit 0ec834b

Browse files
committed
-Sadding updated Example.md file
1 parent 923967f commit 0ec834b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

EXAMPLES.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -643,21 +643,21 @@ mfaClient
643643
<summary>Using coroutines</summary>
644644

645645
```kotlin
646-
try {
647-
val challenge = mfaClient
648-
.challenge(authenticatorId = "phone|dev_xxxx")
649-
.await()
650-
println(challenge)
651-
} catch (e: MfaChallengeException) {
652-
e.printStackTrace()
653-
}
654-
```
655-
</details>
656-
657-
#### Verifying MFA
658646

659-
Complete the MFA flow by verifying with the appropriate method based on the authenticator type.
647+
```kotlin
648+
mfaClient
649+
.challenge(authenticatorId = "phone|dev_xxxx")
650+
.start(object: Callback<Challenge, MfaChallengeException> {
651+
override fun onFailure(exception: MfaChallengeException) { }
660652

653+
override fun onSuccess(challenge: Challenge) {
654+
// Challenge initiated
655+
val challengeType = challenge.challengeType
656+
val oobCode = challenge.oobCode
657+
val bindingMethod = challenge.bindingMethod
658+
}
659+
})
660+
```
661661
##### Verify with OTP (Authenticator App)
662662

663663
```kotlin

0 commit comments

Comments
 (0)