public async Task <IResponseDTO> ActivateUser([FromRoute] int id)
        {
            if (id == LoggedInUserId)
            {
                _response.IsPassed = false;
                _response.Errors.Add("You can't activate yourself.");
                return(_response);
            }
            _response = await _accountService.ActivateUser(id, LoggedInUserId);

            return(_response);
        }
Exemple #2
0
        public async Task <IActionResult> UsersForActivate(string id)
        {
            if (!String.IsNullOrEmpty(id))
            {
                AppUser applicationUser = await _userManager.FindByIdAsync(id);

                if (applicationUser != null)
                {
                    await _accountService.ActivateUser(applicationUser);
                }
            }
            return(RedirectToAction("UsersForActivate", "Account"));
        }
 public async Task Activate(ActivateModel model)
 {
     await _accountService.ActivateUser(Context.ApiKey, model.ActivationCode);
 }