如何发送确认电子邮件并验证aspnetboilerplate模板中的确认
CheckErrors(await _userManager.CreateAsync(user));
var emailConfirmationToken = await _userManager.GenerateEmailConfirmationTokenAsync(user);
生成电子邮件确认令牌并通过邮件发送,但如何将其存储在数据库中以确认电子邮件
答案 0 :(得分:1)
只需将其分配给user
:
CheckErrors(await _userManager.CreateAsync(user));
await CurrentUnitOfWork.SaveChangesAsync();
var emailConfirmationToken = await _userManager.GenerateEmailConfirmationTokenAsync(user);
user.EmailConfirmationCode = emailConfirmationToken; // Here