Allow for captcha solving for reg v2.

This commit is contained in:
Nicholas Tinsley
2024-05-07 18:10:10 -04:00
committed by Alex Hart
parent ba4cdea75d
commit ca14ed9b2c
12 changed files with 247 additions and 66 deletions

View File

@@ -54,12 +54,21 @@ class RegistrationApi(
/**
* Submit a verification code sent by the service via one of the supported channels (SMS, phone call) to prove the registrant's control of the phone number.
*/
fun verifyAccount(verificationCode: String, sessionId: String): NetworkResult<RegistrationSessionMetadataResponse> {
fun verifyAccount(sessionId: String, verificationCode: String): NetworkResult<RegistrationSessionMetadataResponse> {
return NetworkResult.fromFetch {
pushServiceSocket.submitVerificationCode(sessionId, verificationCode)
}
}
/**
* Submits the solved captcha token to the service.
*/
fun submitCaptchaToken(sessionId: String, captchaToken: String): NetworkResult<RegistrationSessionMetadataResponse> {
return NetworkResult.fromFetch {
pushServiceSocket.patchVerificationSession(sessionId, null, null, null, captchaToken, null)
}
}
/**
* Submit the cryptographic assets required for an account to use the service.
*/