public async Task <AccountRecoveryResult> RecoverAsync(string accountRecoveryPayload)
        {
            var payload = OwnIdSerializer.Deserialize <RecoveryPayload>(accountRecoveryPayload);

            if (string.IsNullOrEmpty(payload?.OobCode) || string.IsNullOrEmpty(payload.ApiKey))
            {
                throw new ArgumentException("Recovery code api key cannot be null", nameof(accountRecoveryPayload));
            }

            var url        = $"https://identitytoolkit.googleapis.com/v1/accounts:resetPassword?key={payload.ApiKey}";
            var httpResult = await _httpClient.PostAsJsonAsync(url,
                                                               new { oobCode = payload.OobCode, newPassword = _randomPasswordProvider.Generate() });

            var result =
                await httpResult.Content.ReadFromJsonAsync <RecoverPasswordResponse>(
                    OwnIdSerializer.GetDefaultProperties());

            if (!string.IsNullOrEmpty(result?.Error?.Message))
            {
                if (result.Error.Message == "EXPIRED_OOB_CODE")
                {
                    throw new OwnIdException(ErrorType.RecoveryTokenExpired);
                }

                throw new Exception($"Firebase REST -> {result.Error.Code}: {result.Error.Message}");
            }

            var user = await _firebaseContext.Auth.GetUserByEmailAsync(result !.Email);

            return(new AccountRecoveryResult
            {
                DID = user.Uid
            });
        }
 public UserHandlerAdapter(IUserHandler <TProfile> adaptee)
 {
     _adaptee           = adaptee;
     _serializerOptions = OwnIdSerializer.GetDefaultProperties();
     _serializerOptions.PropertyNamingPolicy = null;
 }