From 63c088ed0ba8aa08d3ddbde35fa01c6116fa3db4 Mon Sep 17 00:00:00 2001 From: JSPark <48265129+pknujsp@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:50:03 +0900 Subject: [PATCH] =?UTF-8?q?#219=20VerifyEmail=20=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../network/datasource/sign/VerifyEmail.kt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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) + } + }, + ) } }