I am trying to integrate Twilio with my VS2015 site, its clear to me that the example given on Twilio was for a straight MVC project and has an AccountController.cs where this code block goes (step 5/6) Twilio Two-Factor Authentication
//
// POST: /Account/SendCode
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> SendCode(SendCodeViewModel model)
{
if (!ModelState.IsValid)
{
return View();
}
// Generate the token and send it
if (!await SignInManager.SendTwoFactorCodeAsync(model.SelectedProvider))
{
return View("Error");
}
return RedirectToAction("VerifyCode",
new { Provider = model.SelectedProvider,
ReturnUrl = model.ReturnUrl,
RememberMe = model.RememberMe });
}
My project has no such controllers and I'm getting an error with their implementation of this
private readonly ITwilioMessageSender _messageSender;
public SmsService() : this(new TwilioMessageSender()) { }
public SmsService(ITwilioMessageSender messageSender)
{
_messageSender = messageSender;
}
CS0051 Inconsistent accessibility: parameter type 'ITwilioMessageSender' is less accessible than method 'SmsService.SmsService(ITwilioMessageSender)'
The error points to:
public SmsService(ITwilioMessageSender messageSender)
{
_messageSender = messageSender;
}
In all, 1 error which I cannot manage to fix, and 1 issue that which I dont know where this step 5/6 code block needs to go. if thats a webform it needs to go in, it wasn't added in this project by default but I dont know. If someone understands this better I'd really appreciate some assistance.