Exemplo n.º 1
0
 public ActionResult SignUpSucceed(AuthViewModel viewModel)
 {
     //trying to add new user
     if (_authManager.AddUserToDb(viewModel.User))
     {
         viewModel.SessionId = _sessionManager.CreateSession(viewModel.User);
         return(View(viewModel));
     }
     else
     {
         return(RedirectToAction("SignUpFailed"));
     }
 }
        public HttpResponseMessage Register(ToDoUser user)
        {
            RegisterUserResponse response = new RegisterUserResponse();

            //trying to add new user
            if (_authManager.AddUserToDb(user))
            {
                response.SessionId = _sessionManager.CreateSession(user);
                return(Request.CreateResponse(HttpStatusCode.Created, response));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.Conflict, response));
            }
        }