diff --git a/core/network/src/main/java/com/android/mediproject/core/network/datasource/sign/VerifyEmail.kt b/core/network/src/main/java/com/android/mediproject/core/network/datasource/sign/VerifyEmail.kt index 27bdcec0..a9e453f8 100644 --- a/core/network/src/main/java/com/android/mediproject/core/network/datasource/sign/VerifyEmail.kt +++ b/core/network/src/main/java/com/android/mediproject/core/network/datasource/sign/VerifyEmail.kt @@ -1,10 +1,24 @@ package com.android.mediproject.core.network.datasource.sign import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserPool +import com.amazonaws.mobileconnectors.cognitoidentityprovider.handlers.GenericHandler +import kotlin.coroutines.resume +import kotlin.coroutines.suspendCoroutine class VerifyEmailImpl(userPool: CognitoUserPool) : AWSAccountManager(userPool), VerifyEmailAWS { - override suspend fun verifyEmail(email: String, code: String): Boolean { - TODO("Not yet implemented") + override suspend fun verifyEmail(email: String, code: String) = suspendCoroutine { + userPool.getUser(email).confirmSignUp( + code, true, + object : GenericHandler { + override fun onSuccess() { + it.resume(true) + } + + override fun onFailure(exception: Exception) { + it.resume(false) + } + }, + ) } }