11091109``` kotlin
11101110myAccountClient.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()
11231123myAccountClient.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
11401140myAccountClient.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
11541154myAccountClient. 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
11711171myAccountClient.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
11861186myAccountClient. 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
0 commit comments