diff --git a/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt b/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt index e8435cf0..7af5e1b8 100644 --- a/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt +++ b/auth0_flutter/android/src/main/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensions.kt @@ -31,6 +31,3 @@ fun AuthenticationException.toMap(): Map { if (exception.getValue("mfa_token") != null) { put("mfa_token", exception.getValue("mfa_token")!!) } } } - -val AuthenticationException.isTooManyAttempts: Boolean - get() = "too_many_attempts" == this.getCode() diff --git a/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt b/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt index 87e5770c..d58cb76f 100644 --- a/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt +++ b/auth0_flutter/android/src/test/kotlin/com/auth0/auth0_flutter/AuthenticationExceptionExtensionsTest.kt @@ -94,7 +94,9 @@ class AuthenticationExceptionExtensionsTest { ) }, "isTooManyAttempts" to { exception: AuthenticationException -> - doReturn("too_many_attempts").`when`(exception).getCode() + `when`(exception.isTooManyAttempts).thenReturn( + true + ) }, "isVerificationRequired" to { exception: AuthenticationException -> `when`(exception.isVerificationRequired).thenReturn(