Found a couple of things

Mar 10, 2012 at 3:12 PM

Hi,

Great starter project! Well done.

A couple of things:

  1. Change LoginURL entry in web.config to ~/Account/Login instead of ~/Account/LogOn (The LogOn action does not exist)
    <forms loginUrl="~/Account/Login" timeout="2880" />
  2. Add a Register(UserModel model) action to your AccountController -- it is missing and you will not be able to create accounts if you arrive at the non-modal registration form:

//
        // POST: /Account/Register

        [AllowAnonymous]
        [HttpPost]
        public ActionResult Register(UserFormModel model)
        {
            if (ModelState.IsValid)
            {
                var command = new UserRegisterCommand
                {
                    FirstName = model.FirstName,
                    LastName = model.LastName,
                    Email = model.Email,
                    Password = model.Password,
                    Activated = true,
                    RoleId = (Int32)UserRoles.User
                };
                IEnumerable<ValidationResult> errors = commandBus.Validate(command);
                ModelState.AddModelErrors(errors);
                if (ModelState.IsValid)
                {
                    var result = commandBus.Submit(command);
                    if (result.Success)
                    {
                        User user = userRepository.Get(u => u.Email == model.Email);
                        formAuthentication.SetAuthCookie(this.HttpContext,
                                                          UserAuthenticationTicketBuilder.CreateAuthenticationTicket(
                                                              user));
                        return RedirectToAction("Index", "Home");
                    }
                    else
                    {
                        ModelState.AddModelError("", "An unknown error occurred.");
                    }
                }
                // If we got this far, something failed, redisplay form
                return View(model);
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }

Other than it, it's perfect. Thanks again.