Created
March 13, 2017 19:25
-
-
Save patkleef/ab37d1f1ed35d006a85de656ca9a3a80 to your computer and use it in GitHub Desktop.
Application Insights Blog - ApplicationInsightsTraceTracking.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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