requestAccountRecovery
client.requestAccountRecovery( email, phoneNumber, success, failure, // Optional arguments redirectUrl, captcha )
About this command
Request account recovery for a profile. The profile receives an email if you pass an email address, or an SMS if you pass a phone number.
You must configure and enable the Email Account Recovery and/or the SMS Account Recovery templates in your ReachFive account settings.
When the ReachFive Console protects forgot password with a Captcha, pass captcha.
This method uses the same Captcha configuration as requestPasswordReset.
Examples
import co.reachfive.identity.sdk.core.models.ReCaptchaToken
val recaptchaToken: String = // Token returned by Google reCAPTCHA in your app
client.requestAccountRecovery(
email = "john.doe@gmail.com",
redirectUrl = "https://example-account-recovery.com",
captcha = ReCaptchaToken(recaptchaToken),
success = { _ -> ... }, // Do something
failure = { error -> ... } // Handle a ReachFive error
)
client.requestAccountRecovery(
phoneNumber = "+33682234940",
success = { _ -> ... }, // Do something
failure = { error -> ... } // Handle a ReachFive error
)
Parameters
The email address of the profile. |
|
The phone number of the profile. Both the international format and the national conventions of the account’s country are accepted if configured in account settings. |
|
The URL sent in the email to which the user is redirected. This URL must be whitelisted in the |
|
Callback called once the request has succeeded. |
|
Callback called once the request has failed. You’ll get a |
|
A Pass a This parameter is required when the ReachFive Console protects the endpoint with a Enable |
Response
Type: Unit
ReachFiveError
message |
The message of the error. |
||||||||||||||
getErrorCode() |
The error code’s enumeration value. |
||||||||||||||
code |
The HTTP status code or SDK error code. See Android SDK errors for more details. |
||||||||||||||
exception |
The stack trace of the error. |
||||||||||||||
data |
Additional data about the error.
|