diff --git a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/UploadManager.kt b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/UploadManager.kt index 1d7e4859..b57fd396 100644 --- a/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/UploadManager.kt +++ b/STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/managers/UploadManager.kt @@ -26,13 +26,12 @@ import com.infomaniak.multiplatform_swisstransfer.data.NewUploadSession import com.infomaniak.multiplatform_swisstransfer.database.controllers.UploadController import com.infomaniak.multiplatform_swisstransfer.exceptions.NotFoundException import com.infomaniak.multiplatform_swisstransfer.exceptions.NullPropertyException -import com.infomaniak.multiplatform_swisstransfer.network.exceptions.ApiException -import com.infomaniak.multiplatform_swisstransfer.network.exceptions.ContainerErrorsException -import com.infomaniak.multiplatform_swisstransfer.network.exceptions.NetworkException -import com.infomaniak.multiplatform_swisstransfer.network.exceptions.UnexpectedApiErrorFormatException +import com.infomaniak.multiplatform_swisstransfer.network.exceptions.* import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.FinishUploadBody import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.InitUploadBody import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.ResendEmailCodeBody +import com.infomaniak.multiplatform_swisstransfer.network.models.upload.request.VerifyEmailCodeBody +import com.infomaniak.multiplatform_swisstransfer.network.models.upload.response.AuthorEmailToken import com.infomaniak.multiplatform_swisstransfer.network.models.upload.response.UploadCompleteResponse import com.infomaniak.multiplatform_swisstransfer.network.repositories.UploadRepository import com.infomaniak.multiplatform_swisstransfer.utils.EmailLanguageUtils @@ -317,6 +316,18 @@ class UploadManager( uploadController.removeData() } + @Throws( + CancellationException::class, + EmailValidationException::class, + ApiException::class, + NetworkException::class, + UnexpectedApiErrorFormatException::class, + UnknownException::class, + ) + suspend fun verifyEmailCode(code: String, email: String): AuthorEmailToken { + return uploadRepository.verifyEmailCode(VerifyEmailCodeBody(code, email)) + } + @Throws( CancellationException::class, ApiException::class,