aspnetboilerplate中的确认电子邮件

时间:2017-12-07 07:44:01

标签: aspnetboilerplate email-confirmation

如何发送确认电子邮件并验证aspnetboilerplate模板中的确认

CheckErrors(await _userManager.CreateAsync(user));
var emailConfirmationToken = await _userManager.GenerateEmailConfirmationTokenAsync(user);

生成电子邮件确认令牌并通过邮件发送,但如何将其存储在数据库中以确认电子邮件

1 个答案:

答案 0 :(得分:1)

只需将其分配给user

CheckErrors(await _userManager.CreateAsync(user));
await CurrentUnitOfWork.SaveChangesAsync();

var emailConfirmationToken = await _userManager.GenerateEmailConfirmationTokenAsync(user);
user.EmailConfirmationCode = emailConfirmationToken; // Here