Skip to content

Commit bb3adc3

Browse files
committed
Example.md file change
1 parent db02f71 commit bb3adc3

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

EXAMPLES.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,9 @@ myAccountClient.enrollEmail("[email protected]")
11091109
```kotlin
11101110
myAccountClient.enrollTotp()
11111111
.start(object : Callback<TotpEnrollmentChallenge, MyAccountException> {
1112-
override fun onSuccess(result: EnrollmentChallenge) {
1113-
val totpChallenge = result as TotpEnrollmentChallenge
1114-
// Show QR code from totpChallenge.barcodeUri or manual code from totpChallenge.manualInputCode
1112+
override fun onSuccess(result: TotpEnrollmentChallenge) {
1113+
// The result is already a TotpEnrollmentChallenge, no cast is needed.
1114+
// Show QR code from result.barcodeUri or manual code from result.manualInputCode
11151115
// Then use result.id and result.authSession to verify.
11161116
}
11171117
override fun onFailure(error: MyAccountException) { }
@@ -1123,9 +1123,9 @@ myAccountClient.enrollTotp()
11231123
myAccountClient.enrollTotp()
11241124
.start(new Callback<TotpEnrollmentChallenge, MyAccountException>() {
11251125
@Override
1126-
public void onSuccess(EnrollmentChallenge result) {
1127-
TotpEnrollmentChallenge totpChallenge = (TotpEnrollmentChallenge) result;
1128-
// Show QR code from totpChallenge.getBarcodeUri() or manual code from totpChallenge.getManualInputCode()
1126+
public void onSuccess(TotpEnrollmentChallenge result) {
1127+
// The result is already a TotpEnrollmentChallenge, no cast is needed.
1128+
// Show QR code from result.getBarcodeUri() or manual code from result.getManualInputCode()
11291129
// Then use result.getId() and result.getAuthSession() to verify.
11301130
}
11311131
@Override
@@ -1139,9 +1139,9 @@ myAccountClient.enrollTotp()
11391139
```kotlin
11401140
myAccountClient.enrollPushNotification()
11411141
.start(object : Callback<TotpEnrollmentChallenge, MyAccountException> {
1142-
override fun onSuccess(result: EnrollmentChallenge) {
1143-
val pushChallenge = result as TotpEnrollmentChallenge // Uses the same response format as TOTP
1144-
// Show QR code from pushChallenge.barcodeUri to be scanned by Auth0 Guardian/Verify
1142+
override fun onSuccess(result: TotpEnrollmentChallenge) {
1143+
// The result is already a TotpEnrollmentChallenge, no cast is needed.
1144+
// Show QR code from result.barcodeUri to be scanned by Auth0 Guardian/Verify
11451145
// Then use result.id and result.authSession to verify.
11461146
}
11471147
override fun onFailure(error: MyAccountException) { }
@@ -1153,15 +1153,15 @@ myAccountClient.enrollPushNotification()
11531153
```java
11541154
myAccountClient.enrollPushNotification()
11551155
.start(new Callback<TotpEnrollmentChallenge, MyAccountException>() {
1156-
@Override
1157-
public void onSuccess(EnrollmentChallenge result) {
1158-
TotpEnrollmentChallenge pushChallenge = (TotpEnrollmentChallenge) result;
1159-
// Show QR code from pushChallenge.getBarcodeUri() to be scanned by Auth0 Guardian/Verify
1160-
// Then use result.getId() and result.getAuthSession() to verify.
1161-
}
1162-
@Override
1163-
public void onFailure(@NonNull MyAccountException error) { }
1164-
});
1156+
@Override
1157+
public void onSuccess(TotpEnrollmentChallenge result) {
1158+
// The result is already a TotpEnrollmentChallenge, no cast is needed.
1159+
// Show QR code from result.getBarcodeUri() to be scanned by Auth0 Guardian/Verify
1160+
// Then use result.getId() and result.getAuthSession() to verify.
1161+
}
1162+
@Override
1163+
public void onFailure(@NonNull MyAccountException error) { }
1164+
});
11651165
```
11661166
</details>
11671167

@@ -1170,9 +1170,9 @@ myAccountClient.enrollPushNotification()
11701170
```kotlin
11711171
myAccountClient.enrollRecoveryCode()
11721172
.start(object : Callback<RecoveryCodeEnrollmentChallenge, MyAccountException> {
1173-
override fun onSuccess(result: EnrollmentChallenge) {
1174-
val recoveryChallenge = result as RecoveryCodeEnrollmentChallenge
1175-
// Display and require the user to save recoveryChallenge.recoveryCode
1173+
override fun onSuccess(result: RecoveryCodeEnrollmentChallenge) {
1174+
// The result is already a RecoveryCodeEnrollmentChallenge, no cast is needed.
1175+
// Display and require the user to save result.recoveryCode
11761176
// This method is already verified.
11771177
}
11781178
override fun onFailure(error: MyAccountException) { }
@@ -1184,16 +1184,16 @@ myAccountClient.enrollRecoveryCode()
11841184

11851185
```java
11861186
myAccountClient.enrollRecoveryCode()
1187-
.start(new Callback<EnrollmentChallenge, MyAccountException>() {
1188-
@Override
1189-
public void onSuccess(RecoveryCodeEnrollmentChallenge result) {
1190-
RecoveryCodeEnrollmentChallenge recoveryChallenge = (RecoveryCodeEnrollmentChallenge) result;
1191-
// Display and require the user to save recoveryChallenge.getRecoveryCode()
1192-
// This method is already verified.
1193-
}
1194-
@Override
1195-
public void onFailure(@NonNull MyAccountException error) { }
1196-
});
1187+
.start(new Callback<RecoveryCodeEnrollmentChallenge, MyAccountException>() {
1188+
@Override
1189+
public void onSuccess(RecoveryCodeEnrollmentChallenge result) {
1190+
// The result is already a RecoveryCodeEnrollmentChallenge, no cast is needed.
1191+
// Display and require the user to save result.getRecoveryCode()
1192+
// This method is already verified.
1193+
}
1194+
@Override
1195+
public void onFailure(@NonNull MyAccountException error) { }
1196+
});
11971197
```
11981198
</details>
11991199

auth0/src/main/java/com/auth0/android/myaccount/MyAccountAPIClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ public class MyAccountAPIClient @VisibleForTesting(otherwise = VisibleForTesting
690690
}
691691

692692
/**
693-
* Confirms the enrollment for factors that do not require an OTP, like Push Notification or Recovery Code.
693+
* Confirms the enrollment for factors that do not require an OTP.
694694
*
695695
* ## Scopes Required
696696
* `create:me:authentication_methods`

0 commit comments

Comments
 (0)