Skip to content

Instantly share code, notes, and snippets.

@patkleef
Created March 13, 2017 19:25
Show Gist options
  • Save patkleef/ab37d1f1ed35d006a85de656ca9a3a80 to your computer and use it in GitHub Desktop.
Save patkleef/ab37d1f1ed35d006a85de656ca9a3a80 to your computer and use it in GitHub Desktop.
Application Insights Blog - ApplicationInsightsTraceTracking.cs
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> ForgotPassword(ForgotPasswordViewModel model)
{
if (ModelState.IsValid)
{
var postVariables = Request.Form.ToString();
var dic = new Dictionary<string, string>();
dic.Add("Post", postVariables);
_telemetryClient.TrackTrace("Forgot password url", dic);
var user = await UserManager.FindByNameAsync(model.Email);
if (user == null || !(await UserManager.IsEmailConfirmedAsync(user.Id)))
{
return View("ForgotPasswordConfirmation");
}
}
return View(model);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment