Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "patrickloui"

Hello, i'm trying to implement email confirmation for the account registration, i'm currently having trouble with

_usermanager.ConfirmEmailAsync(userId,code);

it always returns

{UserId not found}

Here is my implementation of email sending:

var provider = new DpapiDataProtectionProvider("APP");
 _userManager.UserTokenProvider = new DataProtectorTokenProvider<User, long(provider.Create("EmailConfirmation")) as IUserTokenProvider<User, long>;

string code = await _userManager.GenerateEmailConfirmationTokenAsync(adminUser.Id);
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = adminUser.Id, code = code }, protocol: Request.Url.Scheme);

await _emailSender.SendAsync(adminUser.EmailAddress,"Account Confirmation", "Please confirm your account by clicking <a href=\"" + callbackUrl + "\">here</a>",true);

Thank you in advance.

Showing 1 to 1 of 1 entries