Exemple #1
0
        public async Task<ActionResult> Register(RegisterModel model)
        {
            if (model.Password != model.PasswordConfirm)
            {
                model.Password = null;
                model.PasswordConfirm = null;

                ModelState.AddModelError("", "Passwords do not match!");
            }

            if (ModelState.IsValid)
            {
                RegistrationResponseDto response = await _tenantService.RegisterUser(model.ToTenantDto());

                if (response.Success)
                {
                    return RedirectToAction("Success", "User");
                }

                if (response.EmailExists)
                {
                    ModelState.AddModelError("EmailAddress", "Email address already exists");
                }
            }

            return View(model);
        }
Exemple #2
0
        public ActionResult Register()
        {
            var model = new RegisterModel();

            return View("Register", model);
        }