You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
using System;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using Microsoft.AspNet.Identity;
|
|
using Microsoft.AspNet.Identity.Owin;
|
|
using Owin;
|
|
using WebFormApp.Models;
|
|
|
|
namespace WebFormApp.Account
|
|
{
|
|
public partial class Confirm : Page
|
|
{
|
|
protected string StatusMessage
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
string code = IdentityHelper.GetCodeFromRequest(Request);
|
|
string userId = IdentityHelper.GetUserIdFromRequest(Request);
|
|
if (code != null && userId != null)
|
|
{
|
|
var manager = Context.GetOwinContext().GetUserManager<ApplicationUserManager>();
|
|
var result = manager.ConfirmEmail(userId, code);
|
|
if (result.Succeeded)
|
|
{
|
|
successPanel.Visible = true;
|
|
return;
|
|
}
|
|
}
|
|
successPanel.Visible = false;
|
|
errorPanel.Visible = true;
|
|
}
|
|
}
|
|
} |