DocSas/PropertyService.Domain/ModelView/Users/UserProvider.cs
/// <summary>
/// verify recaptcha as an asynchronous operation.
/// </summary>
/// <param name="req">The req.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
verify recaptcha as an asynchronous operation.
verify recaptcha as an asynchronous operation .
public async Task<DSCResponse> VerifyRecaptchaAsync(RecaptchaRequest req)
        {
            var response = new DSCResponse();
                var url = await _settingProvider.GetSetting(SettingKey.RecaptchaUrl);
                var secret = await _settingProvider.GetSetting(SettingKey.RecaptchaSecret);
            if (!string.IsNullOrWhiteSpace(url) && !string.IsNullOrWhiteSpace(secret))
            {
                url = string.Concat(url, $"?secret={secret}&response={req.response}");
                var result = await Utility.HttpPostItemAsync(url, null);               
                if (!string.IsNullOrWhiteSpace(result))
                {
                    var data = Utility.FromJson<RecaptchaResponse>(result);
                    if (data != null)
                    {
                        response.ResponseData = data;
                    }
                }
            }
            return response;
        }
public async Task < DSCResponse > VerifyRecaptchaAsync ( RecaptchaRequest req ) { var response = new DSCResponse ( ) ; var url = await _settingProvider . GetSetting ( SettingKey . RecaptchaUrl ) ; var secret = await _settingProvider . GetSetting ( SettingKey . RecaptchaSecret ) ; if ( ! string . IsNullOrWhiteSpace ( url ) && ! string . IsNullOrWhiteSpace ( secret ) ) { url = string . Concat ( url , $" ?secret= { secret } &response= { req . response } " ) ; var result = await Utility . HttpPostItemAsync ( url , null ) ; if ( ! string . IsNullOrWhiteSpace ( result ) ) { var data = Utility . FromJson < RecaptchaResponse > ( result ) ; if ( data != null ) { response . ResponseData = data ; } } } return response ; }
verify recaptcha as an asynchronous operation.
verify recaptcha as an asynchronous operation .
None
req
RecaptchaRequest
None