Skip to content

Commit 6f98b02

Browse files
committed
feat: update Web3Auth.kt
Signed-off-by: Gaurav Goel <[email protected]>
1 parent 20d30e5 commit 6f98b02

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

core/src/main/java/com/web3auth/core/Web3Auth.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
147147
existingExtraLoginOptions.login_hint = userInfo?.verifierId
148148
initParamsJson.put("extraLoginOptions", gson.toJson(existingExtraLoginOptions))
149149
initParamsJson.put("mfaLevel", MFALevel.MANDATORY.name.lowercase(Locale.ROOT))
150-
val loginIdObject = mapOf("loginId" to sessionId)
150+
val loginIdObject = mapOf("loginId" to sessionId, "platform" to "android")
151151
initParamsJson.put(
152152
"appState",
153153
gson.toJson(loginIdObject).toByteArray(Charsets.UTF_8).toBase64URLString()
@@ -165,10 +165,7 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
165165
val loginIdCf = getLoginId(sessionId, paramsString)
166166
loginIdCf.whenComplete { loginId, error ->
167167
if (error == null) {
168-
val jsonObject = mapOf(
169-
"loginId" to loginId,
170-
"platform" to "android"
171-
)
168+
val jsonObject = mapOf("loginId" to loginId)
172169

173170
val hash = "b64Params=" + gson.toJson(jsonObject).toByteArray(Charsets.UTF_8)
174171
.toBase64URLString()
@@ -369,10 +366,10 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
369366
*/
370367
fun enableMFA(loginParams: LoginParams? = null): CompletableFuture<Boolean> {
371368
enableMfaCompletableFuture = CompletableFuture()
372-
if (web3AuthResponse?.userInfo?.isMfaEnabled == true) {
369+
/*if (web3AuthResponse?.userInfo?.isMfaEnabled == true) {
373370
throwEnableMFAError(ErrorCode.MFA_ALREADY_ENABLED)
374371
return enableMfaCompletableFuture
375-
}
372+
}*/
376373
val sessionId = sessionManager.getSessionId()
377374
if (sessionId.isBlank()) {
378375
throwEnableMFAError(ErrorCode.NOUSERFOUND)

0 commit comments

Comments
 (0)