Skip to content

Commit 79f8922

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
256256
return
257257
}
258258
val b64ParamString = decodeBase64URLString(b64Params).toString(Charsets.UTF_8)
259+
260+
if (b64ParamString.contains("actionType")) {
261+
return
262+
}
263+
259264
val sessionResponse = gson.fromJson(b64ParamString, SessionResponse::class.java)
260265
val sessionId = sessionResponse.sessionId
261266

@@ -366,10 +371,10 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
366371
*/
367372
fun enableMFA(loginParams: LoginParams? = null): CompletableFuture<Boolean> {
368373
enableMfaCompletableFuture = CompletableFuture()
369-
/*if (web3AuthResponse?.userInfo?.isMfaEnabled == true) {
374+
if (web3AuthResponse?.userInfo?.isMfaEnabled == true) {
370375
throwEnableMFAError(ErrorCode.MFA_ALREADY_ENABLED)
371376
return enableMfaCompletableFuture
372-
}*/
377+
}
373378
val sessionId = sessionManager.getSessionId()
374379
if (sessionId.isBlank()) {
375380
throwEnableMFAError(ErrorCode.NOUSERFOUND)

0 commit comments

Comments
 (0)