예제 #1
0
        public async Task <IActionResult> ConfirmEmail(EmailConfirmModel model)
        {
            var user = await _compteRepository.GetUserByEmailAsync(model.Email);

            if (user != null)
            {
                if (user.EmailConfirmed)
                {
                    model.EmailVerifie = true;
                    return(View(model));
                }

                await _compteRepository.GenerateEmailConfirmationTokenAsync(user);

                model.EmailEnvoye = true;
                ModelState.Clear();
            }
            else
            {
                ModelState.AddModelError("", "Quelque chose ne marche pas");
            }
            return(View());
        }