public async Task <IActionResult> Register(RegisterViewModel registerViewModel) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(View(registerViewModel)); } var user = new RCMIdentityUser(registerViewModel.Email, registerViewModel.FirstName, registerViewModel.LastName, registerViewModel.Age); var identityResult = await _rcmUserManager.CreateAsync(user, registerViewModel.Password); if (identityResult.Succeeded) { var code = await _rcmUserManager.GenerateEmailConfirmationTokenAsync(user); await SendAccountConfirmationEmailAsync(user.Email, code); await _rcmSignInManager.SignInAsync(user, isPersistent : false); return(RedirectToPlatform()); } else { NotifyIdentityErrors(identityResult); } return(View(registerViewModel)); }
public async Task <IActionResult> SendConfirmEmail() { var user = await GetUserAsync(); var code = await _rcmUserManager.GenerateEmailConfirmationTokenAsync(user); await SendAccountConfirmationEmailAsync(user.Email, code); return(RedirectToAction(nameof(ConfirmEmailSent))); }