parent
88e05f71a5
commit
ed9e34caab
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Text.Encodings.Web;
|
||||
|
|
@ -15,6 +16,7 @@ using Company.WebApplication1.Controllers;
|
|||
using Company.WebApplication1.Identity.Models;
|
||||
using Company.WebApplication1.Identity.Models.AccountViewModels;
|
||||
using Company.WebApplication1.Identity.Services;
|
||||
using Company.WebApplication1.Models;
|
||||
|
||||
namespace Company.WebApplication1.Identity.Controllers
|
||||
{
|
||||
|
|
@ -346,7 +348,14 @@ namespace Company.WebApplication1.Identity.Controllers
|
|||
throw new ApplicationException($"Unable to load user with ID '{userId}'.");
|
||||
}
|
||||
var result = await _userManager.ConfirmEmailAsync(user, code);
|
||||
return View(result.Succeeded ? "ConfirmEmail" : "Error");
|
||||
if (result.Succeeded)
|
||||
{
|
||||
return View("ConfirmEmail");
|
||||
}
|
||||
else
|
||||
{
|
||||
return View("Error", new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace Company.WebApplication1.Identity.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue