File tree Expand file tree Collapse file tree
android/src/main/java/com/auth0/react Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,13 +55,28 @@ class MfaClient(
5555 }
5656 }
5757
58+ private fun mapFactorType (factor : String ): String? {
59+ return when (factor.lowercase()) {
60+ " otp" , " totp" -> " otp"
61+ " sms" , " phone" -> " sms"
62+ " email" -> " email"
63+ " push" , " push-notification" -> " push-notification"
64+ " oob" -> " oob"
65+ " recovery-code" -> " recovery-code"
66+ " voice" -> " sms"
67+ else -> null
68+ }
69+ }
70+
5871 fun getAuthenticators (mfaToken : String , factorsAllowed : ReadableArray ? , promise : Promise ) {
5972 val mfaClient = client.mfaClient(mfaToken)
6073
6174 val factors = mutableListOf<String >()
6275 factorsAllowed?.let {
6376 for (i in 0 until it.size()) {
64- it.getString(i)?.let { factor -> factors.add(factor) }
77+ it.getString(i)?.let { factor ->
78+ mapFactorType(factor)?.let { mapped -> factors.add(mapped) }
79+ }
6580 }
6681 }
6782
You can’t perform that action at this time.
0 commit comments