Пример #1
0
        public async Task EmailConfirmation(EmailConfirmationInput model)
        {
            var userId = _encryptionService.Decrypt(model.UserId);
            var user   = await _userManager.FindByIdAsync(userId);

            if (user == null || user.EmailConfirmationCode.IsNullOrEmpty() || user.EmailConfirmationCode != model.ConfirmationCode)
            {
                throw new UserFriendlyException("邮箱验证已失效", "请您务必通过点击邮件中的重置链接进入本页面.如果已经这样做了,还存在问题,请重试一遍邮箱验证操作!");
            }

            await _identityUserStore.SetEmailConfirmedAsync(user, true);
        }
Пример #2
0
 public virtual Task EmailConfirmation([FromBody] EmailConfirmationInput model)
 {
     return(_userAppService.EmailConfirmation(model));
 }