コード例 #1
0
        public async Task <ActionResult> ConfirmEmail(string userId, string code)
        {
            if (string.IsNullOrEmpty(userId))
            {
                ModelState.AddModelError(string.Empty, Act.UserIdCantBeNullError);
            }
            if (string.IsNullOrEmpty(code))
            {
                ModelState.AddModelError(string.Empty, Act.ConfirmationCodeCantBeNullError);
            }
            if (!ModelState.IsValid)
            {
                return(View());
            }
            var confirmEmailSuccess = await _userRegistrationService.ConfirmEmail(userId, code);

            if (!confirmEmailSuccess)
            {
                ModelState.AddModelError("", Act.EmailConfirmationError);
            }
            return(View());
        }